RotationMatrix3
public extension RotationMatrix3
-
Creates a 3-dimensional rotation matrix from a set of rotations around three axis.
The orientation provided affects how angles are interpreted as rotations around each axis.
- order: The order of the axis of rotations that the three angles will be interpreted as.
- orientation: The [handedness] of the system. Right-handed systems rotate about the axis in a counter-clockwise direction for positive angles, while left-handed systems rotate clockwise with the same positive angles.
- angle1InRadians: The first angle of the rotation in radians.
- angle2InRadians: The second angle of the rotation in radians.
angle3InRadians: The third angle of the rotation in radians.
Declaration
Swift
@inlinable static func make3DRotation( _ angle1InRadians: Scalar, _ angle2InRadians: Scalar, _ angle3InRadians: Scalar, order: RotationOrder3, orientation: Orientation3 = .rightHanded ) -> Self
Return Value
A rotation matrix that can be used to rotate a vector in 3-space according to the parameters specified.
-
Creates a 3-dimensional rotation matrix that rotates around the X-axis with a given orientation, by a given angle in radians.
Declaration
Swift
@inlinable static func make3DRotationX( _ angleInRadians: Scalar, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3
-
Creates a 3-dimensional rotation matrix that rotates around the Y-axis with a given orientation, by a given angle in radians.
Declaration
Swift
@inlinable static func make3DRotationY( _ angleInRadians: Scalar, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3
-
Creates a 3-dimensional rotation matrix that rotates around the Y-axis with a given orientation, by a given angle in radians.
Declaration
Swift
@inlinable static func make3DRotationZ( _ angleInRadians: Scalar, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3
-
Creates a 3-dimensional rotation matrix that rotates around the given axis with a given orientation, by a given angle in radians.
axis
is normalized prior to the creation of the rotation matrix.Declaration
Swift
@available(*, deprecated, message: "Use make3DRotationFromAxisAngle<Vector: Vector3FloatingPoint>(axis: Vector, _ angle: Angle<Scalar>, orientation: Orientation3 = .rightHanded﹚ instead.") static func make3DRotationFromAxisAngle<Vector: Vector3FloatingPoint>( axis: Vector, _ angleInRadians: Scalar, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3 where Vector.Scalar == Scalar
-
Creates a 3-dimensional rotation matrix that rotates around the given axis with a given orientation, by a given angle in radians.
axis
is normalized pior to the creation of the rotation matrix.Declaration
Swift
static func make3DRotationFromAxisAngle<Vector: Vector3FloatingPoint>( axis: Vector, _ angle: Angle<Scalar>, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3 where Vector.Scalar == Scalar
-
Creates a 3-dimensional rotation matrix that rotates around a single axis with an angle and direction that when applied to
vectorA
, turns it into the same direction asvectorB
, with a given orientation.vectorA
andvectorB
are assumed to be directional vectors, and will be normalized pior to the creation of the rotation matrix.If
vectorA
andvectorB
point on the same direction, an identity matrix is returned, instead.Declaration
Swift
static func make3DRotationBetween<Vector: Vector3FloatingPoint>( _ vectorA: Vector, _ vectorB: Vector, orientation: Orientation3 = .rightHanded ) -> RotationMatrix3 where Vector.Scalar == Scalar