|
1 | 1 | # Transformation
|
2 | 2 |
|
3 |
| -`Transformation.swift` encapsulates an API for working with other representations of transformations, such as [*Angle-Axis*][angle_axis_wiki], [*Polar*][polar_wiki] and [*Rotation Vector*][rotation_vector_wiki]. The API provides operations to convert from these representations to `Quaternion` and vice versa. |
4 |
| -Additionally, the API provides a method to directly rotate an arbitrary vector by a quaternion and thus avoids the calculation of an intermediate representation to any other form in the process. |
| 3 | +In computer science, quaternions are frequently used to represent three-dimensional rotations; as quaternions have some [advantages over other representations][advantages]. |
| 4 | + |
| 5 | +`Transformation.swift` encapsulates an API to interact with the three-dimensional transformation properties of quaternions. It provides conversions to and from other rotation representations, namely [*Angle-Axis*][angle_axis_wiki], [*Rotation Vector*][rotation_vector_wiki] and [*Polar decomposition*][polar_wiki], as well as it provides methods to directly transform arbitrary vectors by quaternions. |
5 | 6 |
|
6 | 7 | ## Policies
|
7 | 8 |
|
8 |
| -- zero and non-finite quaternions have indeterminate transformation properties and can not be converted to another representation. Thus, |
| 9 | +- zero and non-finite quaternions have indeterminate transformation properties and can not be converted to other representations. Thus, |
9 | 10 |
|
10 |
| - - The `angle` property of `.zero` or `.infinity` is `RealType.nan`. |
11 |
| - - The `axis` property of `.zero` or `.infinity` is `RealType.nan` in all lanes. |
12 |
| - - The `rotationVector` property of `.zero` or `.infinity` is `RealType.nan` in all lanes. |
| 11 | + - The `angle` of `.zero` or `.infinity` is `RealType.nan`. |
| 12 | + - The `axis` of `.zero` or `.infinity` is `RealType.nan` in all lanes. |
| 13 | + - The `rotationVector` of `.zero` or `.infinity` is `RealType.nan` in all lanes. |
| 14 | + - The polar `phase` of `.zero` or `.infinity` is `RealType.nan` |
13 | 15 |
|
14 |
| -- Quaternions with `angle == .zero` have an indeterminate axis. Thus, |
| 16 | +- Quaternions with an `angle` of `.zero` have an indeterminate rotation axis. Thus, |
15 | 17 |
|
16 |
| - - the `axis` property of `angle == .zero` is `RealType.nan` in all lanes. |
17 |
| - - the `rotationVector` property of `angle == .zero` is `RealType.nan` in all lanes. |
| 18 | + - the `axis` of `angle == .zero` is `RealType.nan` in all lanes. |
| 19 | + - the `rotationVector` of `angle == .zero` is `RealType.nan` in all lanes. |
18 | 20 |
|
19 | 21 |
|
| 22 | +[advantages]: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Advantages_of_quaternions |
20 | 23 | [angle_axis_wiki]: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Recovering_the_axis-angle_representation
|
21 | 24 | [polar_wiki]: https://en.wikipedia.org/wiki/Polar_decomposition#Quaternion_polar_decomposition
|
22 | 25 | [rotation_vector_wiki]: https://en.wikipedia.org/wiki/Axis–angle_representation#Rotation_vector
|
23 |
| - |
|
0 commit comments