Update Transformation.md of quaternions

This commit is contained in:
Markus Winter authored and Stephen Canon committed 2025-08-14 21:47:27 -04:00
1 parent 4b8ae5dd44
commit acbdeeaa3d
1 file changed
+12 -10
+12 -10
View File
@@ -1,23 +1,25 @@
# Transformation
`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.
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.
In computer science, quaternions are frequently used to represent three-dimensional rotations; as quaternions have some dvantages over other representations][advantages].
`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.
## Policies
- zero and non-finite quaternions have indeterminate transformation properties and can not be converted to another representation. Thus,
- zero and non-finite quaternions have indeterminate transformation properties and can not be converted to other representations. Thus,
- The `angle` property of `.zero` or `.infinity` is `RealType.nan`.
- The `axis` property of `.zero` or `.infinity` is `RealType.nan` in all lanes.
- The `rotationVector` property of `.zero` or `.infinity` is `RealType.nan` in all lanes.
- The `angle` of `.zero` or `.infinity` is `RealType.nan`.
- The `axis` of `.zero` or `.infinity` is `RealType.nan` in all lanes.
- The `rotationVector` of `.zero` or `.infinity` is `RealType.nan` in all lanes.
- The polar `phase` of `.zero` or `.infinity` is `RealType.nan`
- Quaternions with `angle == .zero` have an indeterminate axis. Thus,
- Quaternions with an `angle` of `.zero` have an indeterminate rotation axis. Thus,
- the `axis` property of `angle == .zero` is `RealType.nan` in all lanes.
- the `rotationVector` property of `angle == .zero` is `RealType.nan` in all lanes.
- the `axis` of `angle == .zero` is `RealType.nan` in all lanes.
- the `rotationVector` of `angle == .zero` is `RealType.nan` in all lanes.
[advantages]: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Advantages_of_quaternions
[angle_axis_wiki]: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Recovering_the_axis-angle_representation
[polar_wiki]: https://en.wikipedia.org/wiki/Polar_decomposition#Quaternion_polar_decomposition
[rotation_vector_wiki]: https://en.wikipedia.org/wiki/Axis–angle_representation#Rotation_vector