<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Spatial"
    ],
    "preciseIdentifier" : "Spatial"
  },
  "title" : "Spatial"
}
-->

# Spatial

Create and manipulate 3D mathematical primitives.

## Overview

The Spatial module is a lightweight 3D mathematical library that provides a simple API for working with 3D primitives. Much of its functionality is similar to the 2D geometry support in Core Graphics, but in three dimensions.

## Topics

### Data structures

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

A three-element vector.

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

A single-precision structure that defines a three-element vector

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

Constants that describe an axis.

### 2D primitives

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

A geometric angle with a value you access in either radians or degrees.

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

A single-precision geometric angle whose value you access in either radians or degrees.

### 3D primitives

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

A point in a 3D coordinate system.

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

A single-precision structure that contains a point in a three-dimensional coordinate system.

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

A size that describes width, height, and depth in a 3D coordinate system.

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

A single-precision structure that contains width, height, and depth values.

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

A rectangle in a 3D coordinate system.

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

A single-precision structure that contains the location and dimensions of a 3D rectangle.

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

A rotation in three dimensions.

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

A single-precision structure that represents a rotation in three dimensions.

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

A 3D rotation axis.

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

A 3D axis.

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

A structure that contains a 3D position and a 3D rotation.

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

A single-precision structure that contains a position and rotation.

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

A structure that contains a position, rotation, and scale.

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

A structure that contains a position, rotation, and scale.

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

A structure that defines spherical coordinates in radial, inclination, azimuthal order.

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

A single-precision structure that defines spherical coordinates in radial, inclination, azimuthal order.

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

A ray in a 3D coordinate system.

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

A single-precision structure that contains the origin and direction of a 3D ray.

### Affine and projective transforms

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

A 3D affine transformation matrix.

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

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

A 3D projective transformation matrix.

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

A single-precision 3D projective transformation matrix.

### Converting between coordinate spaces

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

A type that represents a coordinate space which you can use to convert
values to and from other coordinate spaces.

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

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

An opaque value which can be resolved to a concrete value
in a `CoordinateSpace3D`

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

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

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

A coordinate space that represents a world reference point.

### Applying trigonometric functions

[`cos(_:)`](/documentation/Spatial/cos(_:)-609v4)

[`cos(_:)`](/documentation/Spatial/cos(_:)-79fxe)

[`cosh(_:)`](/documentation/Spatial/cosh(_:)-6cg6v)

[`cosh(_:)`](/documentation/Spatial/cosh(_:)-9mmhn)

[`sin(_:)`](/documentation/Spatial/sin(_:)-46su7)

[`sin(_:)`](/documentation/Spatial/sin(_:)-5tddt)

[`sinh(_:)`](/documentation/Spatial/sinh(_:)-4m7ds)

[`sinh(_:)`](/documentation/Spatial/sinh(_:)-8kigy)

[`tan(_:)`](/documentation/Spatial/tan(_:)-1sjgu)

[`tan(_:)`](/documentation/Spatial/tan(_:)-9x99s)

[`tanh(_:)`](/documentation/Spatial/tanh(_:)-1f341)

[`tanh(_:)`](/documentation/Spatial/tanh(_:)-5yozs)

### Protocols

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

A set of methods common to Spatial primitives.

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

A set of methods that defines the interface to rotate Spatial entities.

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

A set of methods that defines the interface to scale Spatial entities.

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

A set of methods that defines the interface to shear Spatial entities.

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

A set of methods that defines the interface to translate Spatial entities.

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

A set of methods for working with Spatial primitives with volume.

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

A set of methods that defines the interface for Spatial entities that can be clamped to a volume.

### Macros

[Macros & Global Variables](/documentation/Spatial/Spatial-macros)



---

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)