mirror of
https://github.com/apple/swift-numerics
synced 2026-11-24 04:38:11 +00:00
1.1 KiB
1.1 KiB
Transformation
Transformation.swift encapsulates an API for working with other representations of transformations, such as Angle-Axis, Polar and Rotation Vector. 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.
Policies
-
zero and non-finite quaternions have indeterminate transformation properties and can not be converted to another representation. Thus,
- The
angleproperty of.zeroor.infinityisRealType.nan. - The
axisproperty of.zeroor.infinityisRealType.nanin all lanes. - The
rotationVectorproperty of.zeroor.infinityisRealType.nanin all lanes.
- The
-
Quaternions with
angle == .zerohave an indeterminate axis. Thus,- the
axisproperty ofangle == .zeroisRealType.nanin all lanes. - the
rotationVectorproperty ofangle == .zeroisRealType.nanin all lanes.
- the