mirror of
https://github.com/apple/swift-numerics
synced 2026-11-24 04:38:11 +00:00
803 B
803 B
Transformation
Rotation.swift encapsulates an API for working with other forms of rotation representations, such as Angle/Axis, Polar or Rotation Vector. The API provides conversion 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 an indeterminate angle and axis. Thus,
the
angleproperty of.zeroor.infinityisRealType.nan, and theaxisproperty of.zeroor.infinityis.nanin all lanes. - Quaternions with
angle == .zerohave an indeterminate axis. Thus, theaxisproperty is.nanin all lanes.