<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Spatial",
  "identifier" : "/documentation/Spatial/Rotation3D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Spatial"
    ],
    "preciseIdentifier" : "c:@UA@SPRotation3D"
  },
  "title" : "Rotation3D"
}
-->

# Rotation3D

A rotation in three dimensions.

```
struct Rotation3D
```

## Topics

### Creating a 3D rotation structure

[`init()`](/documentation/Spatial/Rotation3D/init()-2uz53)

Creates a rotation.

[`init()`](/documentation/Spatial/Rotation3D/init()-krpj)

Creates a rotation structure.

[`init(eulerAngles:)`](/documentation/Spatial/Rotation3D/init(eulerAngles:))

Creates a rotation structure with the specified Euler angles.

[`init(eulerAngles:)`](/documentation/Spatial/Rotation3D/init(eulerAngles:))

Creates a rotation structure with the specified Euler angles.

[`EulerAngles`](/documentation/Spatial/EulerAngles)

A vector that represents three Euler angles and specifies the angle ordering.

[`init(quaternion:)`](/documentation/Spatial/Rotation3D/init(quaternion:)-2c79y)

Creates a rotation axis from the specified double-precision quaternion.

[`init(_:)`](/documentation/Spatial/Rotation3D/init(_:)-8z2bn)

Creates a rotation from the specified double-precision quaternion.

[`init(_:)`](/documentation/Spatial/Rotation3D/init(_:)-829qb)

Creates a rotation axis from the specified single-precision quaternion.

[`init(angle:axis:)`](/documentation/Spatial/Rotation3D/init(angle:axis:))

Creates a rotation structure with the specified axis and the specified angle from Spatial structures.

[`init(position:target:up:)`](/documentation/Spatial/Rotation3D/init(position:target:up:))

Creates a rotation structure that represents the look-at direction from a position to a target.

[`init(forward:)`](/documentation/Spatial/Rotation3D/init(forward:))

Creates a rotation with the specified forward vector.

[`init(forward:up:)`](/documentation/Spatial/Rotation3D/init(forward:up:))

Creates a rotation with the specified forward and up vectors.

[`SPRotation3DMakeWithQuaternion`](/documentation/Spatial/SPRotation3DMakeWithQuaternion)

[`SPRotation3DMake`](/documentation/Spatial/SPRotation3DMake-2i9jt)

Creates a rotation structure.

[`SPRotation3DMakeLookAt`](/documentation/Spatial/SPRotation3DMakeLookAt-6ypo8)

Creates a rotation structure that’s the look-at direction from a position to a target.

[`SPRotation3DMakeLookAt`](/documentation/Spatial/SPRotation3DMakeLookAt-4xrh6)

[`init(forward:up:)`](/documentation/Spatial/Rotation3D/init(forward:up:))

Creates a rotation with the specified forward and up vectors.

[`SPRotationAxis3DMakeWithVector`](/documentation/Spatial/SPRotationAxis3DMakeWithVector-1n9ib)

Creates a rotation axis from the specified double-precision vector.

[`SPRotationAxis3DMakeWithVector`](/documentation/Spatial/SPRotationAxis3DMakeWithVector-kk1p)

### Inspecting a 3D rotation’s properties

[`angle`](/documentation/Spatial/Rotation3D/angle)

The angle of the rotation.

[`axis`](/documentation/Spatial/Rotation3D/axis)

The axis of the rotation.

[`eulerAngles(order:)`](/documentation/Spatial/Rotation3D/eulerAngles(order:))

Returns a rotation’s Euler angles.

[`SPRotation3DGetAngle`](/documentation/Spatial/SPRotation3DGetAngle)

The angle of the rotation.

[`SPRotation3DGetAxis`](/documentation/Spatial/SPRotation3DGetAxis)

The axis of the rotation.

[`EulerAngles`](/documentation/Spatial/EulerAngles)

A vector that represents three Euler angles and specifies the angle ordering.

[`quaternion`](/documentation/Spatial/Rotation3D/quaternion)

A quaternion that represents the rotation.

[`vector`](/documentation/Spatial/Rotation3D/vector)

The underlying vector of the rotation.

[`vector`](/documentation/Spatial/SPRotation3D/vector)

The underlying vector of the rotation.

[`SPRotation3DGetQuaternion`](/documentation/Spatial/SPRotation3DGetQuaternion)

A quaternion that represents the rotation.

[`SPRotationAxis3DGetVector`](/documentation/Spatial/SPRotationAxis3DGetVector)

A simd three-element vector that contains the x-, y-, and z-coordinate values.

### Setting a 3D rotation’s properties

[`SPRotation3DSetAngle`](/documentation/Spatial/SPRotation3DSetAngle)

Sets a rotation’s angle.

[`SPRotation3DSetAxis`](/documentation/Spatial/SPRotation3DSetAxis)

Sets a rotation’s axis.

### Transforming a 3D rotation structure

[`slerp(from:to:t:along:)`](/documentation/Spatial/Rotation3D/slerp(from:to:t:along:))

Returns the spherical linear interpolation along either the shortest or the longest arc between two rotations.

[`Rotation3D.SlerpPath`](/documentation/Spatial/Rotation3D/SlerpPath)

Constants that define the arc that a slerp operation takes.

[`inverse`](/documentation/Spatial/Rotation3D/inverse)

The inverse of the rotation.

[`SPRotation3DSlerp`](/documentation/Spatial/SPRotation3DSlerp)

Returns the spherical linear interpolation along the shortest arc between two rotations.

[`SPRotation3DSlerpLongest`](/documentation/Spatial/SPRotation3DSlerpLongest)

Returns the spherical linear interpolation along the longest arc between two rotations.

[`identity`](/documentation/Spatial/Rotation3D/identity)

The identity rotation.

### Decomposing a 3D rotation structure

[`swing(twistAxis:)`](/documentation/Spatial/Rotation3D/swing(twistAxis:))

Returns the swing component of the rotation’s swing-twist decomposition for a given twist axis.

[`twist(twistAxis:)`](/documentation/Spatial/Rotation3D/twist(twistAxis:))

Returns the twist component of the rotation’s swing-twist decomposition for a given twist axis.

[`swingTwist(twistAxis:)`](/documentation/Spatial/Rotation3D/swingTwist(twistAxis:))

Returns the rotation’s swing-twist decomposition for a given twist axis.

[`swing(twistAxis:)`](/documentation/Spatial/Rotation3D/swing(twistAxis:))

Returns the swing component of the rotation’s swing-twist decomposition for a given twist axis.

[`twist(twistAxis:)`](/documentation/Spatial/Rotation3D/twist(twistAxis:))

Returns the twist component of the rotation’s swing-twist decomposition for a given twist axis.

### Checking characteristics

[`isIdentity`](/documentation/Spatial/Rotation3D/isIdentity)

A Boolean value that indicates whether the rotation is the identity rotation.

[`isIdentity`](/documentation/Spatial/Rotation3D/isIdentity)

A Boolean value that indicates whether the rotation is the identity rotation.

[`SPRotation3DIsValid`](/documentation/Spatial/SPRotation3DIsValid)

A Boolean value that indicates whether the rotation represents a valid value.

[`SPRotation3DInvalid`](/documentation/Spatial/SPRotation3DInvalid)

The null rotation that represents an invalid value.

### Comparing values

[`isApproximatelyEqual(to:tolerance:)`](/documentation/Spatial/Rotation3D/isApproximatelyEqual(to:tolerance:))

[`==(_:_:)`](/documentation/Spatial/Rotation3D/==(_:_:))

Returns a Boolean value that indicates whether two values are equal.

[`SPRotation3DEqualToRotation`](/documentation/Spatial/SPRotation3DEqualToRotation)

Returns a Boolean value that indicates whether two values are equal.

[`SPRotation3DAlmostEqualToRotation`](/documentation/Spatial/SPRotation3DAlmostEqualToRotation-53c20)

[`SPRotation3DAlmostEqualToRotation`](/documentation/Spatial/SPRotation3DAlmostEqualToRotation-3deix)

### Applying arithmetic operations

[`*(_:_:)`](/documentation/Spatial/Rotation3D/*(_:_:)-1tc8f)

Returns the product of two rotations.

[`*(_:_:)`](/documentation/Spatial/Rotation3D/*(_:_:)-5dxqv)

Returns the spherical linear interpolation between the identity rotation and the left-hand-side rotation at the right-hand-side interpolation parameter.

[`*(_:_:)`](/documentation/Spatial/Rotation3D/*(_:_:)-9t389)

Returns the spherical linear interpolation between the identity rotation and the right-hand-side rotation at the left-hand-side interpolation parameter.

[`*(_:_:)`](/documentation/Spatial/*(_:_:))

Returns the rotatable entity that results from applying the rotatable entity.

[`*=(_:_:)`](/documentation/Spatial/Rotation3D/*=(_:_:))

Computes the product of two rotations and stores the result in the left-hand-side variable.

### Interpolating a 3D rotation structure

[`spline(leftEndpoint:from:to:rightEndpoint:t:)`](/documentation/Spatial/Rotation3D/spline(leftEndpoint:from:to:rightEndpoint:t:))

Returns an interpolated value between two rotations along a spherical cubic spline.

[`SPRotation3DSpline`](/documentation/Spatial/SPRotation3DSpline)

Returns an interpolated value between two rotations along a spherical cubic spline.

### Deprecated symbols

[`init(_:_:_:order:)`](/documentation/Spatial/EulerAngles/init(_:_:_:order:))

Creates a new Euler angles structure from the specified angle structures and order.

[`init(eye:target:up:)`](/documentation/Spatial/Rotation3D/init(eye:target:up:))

Creates a rotation structure that’s the look-at direction from a position to a target.

[`init(axis:angle:)`](/documentation/Spatial/Rotation3D/init(axis:angle:))

Creates a rotation structure with the specified axis and the specified angle from Spatial structures.

[`init(quaternion:)`](/documentation/Spatial/Rotation3D/init(quaternion:)-6ajmn)

Creates a rotation axis from the specified single-precision quaternion.

[`zero`](/documentation/Spatial/Rotation3D/zero)

The rotation with the zero value.

[`isZero`](/documentation/Spatial/Rotation3D/isZero)

A Boolean value that indicates whether the rotation is zero.

[`SPEulerAngleOrder`](/documentation/Spatial/SPEulerAngleOrder)

Constants that describe the order of Euler angles.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)