@@ -121,8 +121,8 @@ extension Quaternion {
121
121
122
122
/// The [polar decomposition][wiki].
123
123
///
124
- /// Returns the length of this quaternion, half rotation angle in radians of
125
- /// *[0, π]* range and the rotation axis as SIMD3 vector of unit length.
124
+ /// Returns the length of this quaternion, phase in radians of range *[0, π]*
125
+ /// and the rotation axis as SIMD3 vector of unit length.
126
126
///
127
127
/// Edge cases:
128
128
/// -
@@ -144,7 +144,7 @@ extension Quaternion {
144
144
/// - `init(rotation:)`
145
145
///
146
146
/// [wiki]: https://en.wikipedia.org/wiki/Polar_decomposition#Quaternion_polar_decomposition
147
- public var polar : ( length: RealType , halfAngle : RealType , axis: SIMD3 < RealType > ) {
147
+ public var polar : ( length: RealType , phase : RealType , axis: SIMD3 < RealType > ) {
148
148
( length, halfAngle, axis)
149
149
}
150
150
@@ -257,11 +257,11 @@ extension Quaternion {
257
257
258
258
/// Creates a quaternion specified with [polar coordinates][wiki].
259
259
///
260
- /// This initializer reads given `length`, `halfAngle ` and `axis` values and
260
+ /// This initializer reads given `length`, `phase ` and `axis` values and
261
261
/// creates a quaternion of equal rotation properties and specified *length*
262
262
/// using the following equation:
263
263
///
264
- /// Q = (cos(halfAngle ), axis * sin(halfAngle )) * length
264
+ /// Q = (cos(phase ), axis * sin(phase )) * length
265
265
///
266
266
/// Given `axis` gets normalized if it is not of unit length.
267
267
///
@@ -293,11 +293,11 @@ extension Quaternion {
293
293
///
294
294
/// [wiki]: https://en.wikipedia.org/wiki/Polar_decomposition#Quaternion_polar_decomposition
295
295
@inlinable
296
- public init ( length: RealType , halfAngle : RealType , axis: SIMD3 < RealType > ) {
296
+ public init ( length: RealType , phase : RealType , axis: SIMD3 < RealType > ) {
297
297
let axisLength : RealType = . sqrt( axis. lengthSquared)
298
- if halfAngle . isFinite && axisLength. isNormal {
298
+ if phase . isFinite && axisLength. isNormal {
299
299
self = Quaternion (
300
- halfAngle: halfAngle ,
300
+ halfAngle: phase ,
301
301
unitAxis: axis/ axisLength
302
302
) . multiplied ( by: length)
303
303
} else {
0 commit comments