<!--
{
  "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/Point3D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Spatial"
    ],
    "preciseIdentifier" : "c:@UA@SPPoint3D"
  },
  "title" : "Point3D"
}
-->

# Point3D

A point in a 3D coordinate system.

```
struct Point3D
```

## Topics

### Creating a 3D point structure

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

Creates a point.

[`init(x: Double, y: Double, z: Double)`](/documentation/Spatial/Point3D/init(x:y:z:)-3lary)

Creates a point from the specified double-precision values.

[`init<T>(x: T, y: T, z: T)`](/documentation/Spatial/Point3D/init(x:y:z:)-28jhw)

Creates a point from the specified floating-point values.

[`init(vector: simd_double3)`](/documentation/Spatial/Point3D/init(vector:))

Creates a point from the specified double-precision vector.

[`init(Size3D)`](/documentation/Spatial/Point3D/init(_:)-1f1ha)

Creates a point from the specified Spatial size structure.

[`init(simd_float3)`](/documentation/Spatial/Point3D/init(_:)-1kved)

Creates a point from the specified single-precision vector.

[`init(Vector3D)`](/documentation/Spatial/Point3D/init(_:)-34plj)

Creates a point from the specified Spatial vector.

[`init(simd_double3)`](/documentation/Spatial/Point3D/init(_:)-4gu20)

Creates a point from the specified double-precision vector.

[`init(SphericalCoordinates3D)`](/documentation/Spatial/Point3D/init(_:)-50tw4)

Returns a Spatial point that represents the Cartesian coordinates of the specified spherical coordinates structure.

[`static SPPoint3D SPPoint3DMakeWithSize(SPSize3D size);`](/documentation/Spatial/SPPoint3DMakeWithSize)

Creates a point from the specified Spatial size structure.

[`static SPPoint3D SPPoint3DMakeWithSphericalCoordinates(SPSphericalCoordinates3D coords);`](/documentation/Spatial/SPPoint3DMakeWithSphericalCoordinates)

Returns a Spatial point that represents the Cartesian coordinates of the specified spherical coordinates structure.

[`static SPPoint3D SPPoint3DMakeWithVector(SPVector3D xyz);`](/documentation/Spatial/SPPoint3DMakeWithVector-39d4f)

Creates a point from the specified double-precision vector.

[`static SPPoint3D SPPoint3DMakeWithVector(simd_double3 xyz);`](/documentation/Spatial/SPPoint3DMakeWithVector-6eegc)

### Constants

[`static const SPPoint3D SPPoint3DInfinity;`](/documentation/Spatial/SPPoint3DInfinity)

The point with infinite x-, y-, and z-coordinate values.

[`static const SPPoint3D SPPoint3DZero;`](/documentation/Spatial/SPPoint3DZero)

The point with the zero value.

### Inspecting a 3D point’s properties

[`double x;`](/documentation/Spatial/SPPoint3D/x)

The x-coordinate value.

[`double y;`](/documentation/Spatial/SPPoint3D/y)

The y-coordinate value.

[`double z;`](/documentation/Spatial/SPPoint3D/z)

The z-coordinate value.

[`var x: Double`](/documentation/Spatial/Point3D/x)

The x-coordinate value.

[`var y: Double`](/documentation/Spatial/Point3D/y)

The y-coordinate value.

[`var z: Double`](/documentation/Spatial/Point3D/z)

The z-coordinate value.

[`var vector: simd_double3`](/documentation/Spatial/Point3D/vector)

[`var magnitudeSquared: Double`](/documentation/Spatial/Point3D/magnitudeSquared)

[`static simd_double3 SPPoint3DGetVector(SPPoint3D point);`](/documentation/Spatial/SPPoint3DGetVector)

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

### Checking characteristics

[`func distance(to: Point3D) -> Double`](/documentation/Spatial/Point3D/distance(to:))

Returns the distance between two points.

[`static bool SPPoint3DIsFinite(SPPoint3D point);`](/documentation/Spatial/SPPoint3DIsFinite)

[`static bool SPPoint3DIsNaN(SPPoint3D point);`](/documentation/Spatial/SPPoint3DIsNaN)

[`static bool SPPoint3DIsZero(SPPoint3D point);`](/documentation/Spatial/SPPoint3DIsZero)

### Transforming a 3D point structure

[`func applying(ScaledPose3D) -> Point3D`](/documentation/Spatial/Point3D/applying(_:)-1f4em)

Returns a point that’s transformed by the specified scaled pose.

[`func applying(ScaledPose3D) -> Point3D`](/documentation/Spatial/Point3D/applying(_:)-1f4em)

Returns a point that’s transformed by the specified scaled pose.

[`func applying(Pose3D) -> Point3D`](/documentation/Spatial/Point3D/applying(_:)-7ulww)

Returns a point that results from applying the specified pose.

[`func clamp(to: Rect3D)`](/documentation/Spatial/Point3D/clamp(to:))

Clamps the mutable point to the specified rectangle.

[`func scale(by: Double)`](/documentation/Spatial/Point3D/scale(by:))

[`static SPPoint3D SPPoint3DApplyAffineTransform(SPPoint3D point, SPAffineTransform3D transform);`](/documentation/Spatial/SPPoint3DApplyAffineTransform)

Returns a point that results from applying the specified affine transform.

[`static SPPoint3D SPPoint3DApplyPose(SPPoint3D point, SPPose3D pose);`](/documentation/Spatial/SPPoint3DApplyPose)

Returns a point that results from applying the specified pose.

[`static SPPoint3D SPPoint3DApplyProjectiveTransform(SPPoint3D point, SPProjectiveTransform3D transform);`](/documentation/Spatial/SPPoint3DApplyProjectiveTransform)

Returns a point that results from applying the specified projective transform.

[`static SPPoint3D SPPoint3DApplyScaledPose(SPPoint3D point, SPScaledPose3D pose);`](/documentation/Spatial/SPPoint3DApplyScaledPose)

Returns a point that’s transformed by the specified scaled pose.

[`static SPPoint3D SPPoint3DRotate(SPPoint3D point, SPRotation3D rotation);`](/documentation/Spatial/SPPoint3DRotate)

Returns a point that results from applying the specified rotation.

[`func rotated(by: Rotation3D, around: Point3D) -> Point3D`](/documentation/Spatial/Point3D/rotated(by:around:)-4tmfq)

Returns a point that results from applying a rotation around the specified point.

[`static SPPoint3D SPPoint3DRotateByQuaternion(SPPoint3D point, simd_quatd quaternion);`](/documentation/Spatial/SPPoint3DRotateByQuaternion)

Returns a point that results from rotating with the specified quaternion.

[`func rotated(by: simd_quatd, around: Point3D) -> Point3D`](/documentation/Spatial/Point3D/rotated(by:around:)-chuy)

Returns a point that results from rotating with a quaternion around the specified point.

[`static SPPoint3D SPPoint3DTranslate(SPPoint3D point, SPSize3D offset);`](/documentation/Spatial/SPPoint3DTranslate-8xo6b)

Returns a point with an origin that’s offset by the specified size.

[`static SPPoint3D SPPoint3DTranslate(SPPoint3D point, SPVector3D offset);`](/documentation/Spatial/SPPoint3DTranslate-9aj4h)

Returns a point with an origin that’s offset by the specified vector.

[`static SPPoint3D SPPoint3DUnapplyAffineTransform(SPPoint3D point, SPAffineTransform3D transform);`](/documentation/Spatial/SPPoint3DUnapplyAffineTransform)

Returns a point that results from unapplying the specified affine transform.

[`static SPPoint3D SPPoint3DUnapplyPose(SPPoint3D point, SPPose3D pose);`](/documentation/Spatial/SPPoint3DUnapplyPose)

Returns a point that results from unapplying the specified pose.

[`static SPPoint3D SPPoint3DUnapplyProjectiveTransform(SPPoint3D point, SPProjectiveTransform3D transform);`](/documentation/Spatial/SPPoint3DUnapplyProjectiveTransform)

Returns a point that results from unapplying the specified projective transform.

[`static SPPoint3D SPPoint3DUnapplyScaledPose(SPPoint3D point, SPScaledPose3D pose);`](/documentation/Spatial/SPPoint3DUnapplyScaledPose)

Returns a point that’s transformed by the inverse of the specified scaled pose.

[`func unapplying(Pose3D) -> Point3D`](/documentation/Spatial/Point3D/unapplying(_:)-5hk6t)

Returns a point that results from unapplying the specified pose.

[`func unapplying(ScaledPose3D) -> Point3D`](/documentation/Spatial/Point3D/unapplying(_:)-7wdtv)

Returns a point that’s transformed by the inverse of the specified scaled pose.

[`func unapplying(ScaledPose3D) -> Point3D`](/documentation/Spatial/Point3D/unapplying(_:)-7wdtv)

Returns a point that’s transformed by the inverse of the specified scaled pose.

### Comparing values

[`static func == (Point3D, Point3D) -> Bool`](/documentation/Spatial/Point3D/==(_:_:))

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

[`func isApproximatelyEqual(to: Point3D, tolerance: Double) -> Bool`](/documentation/Spatial/Point3D/isApproximatelyEqual(to:tolerance:))

[`static bool SPPoint3DAlmostEqualToPoint(SPPoint3D p1, SPPoint3D p2);`](/documentation/Spatial/SPPoint3DAlmostEqualToPoint-8qyca)

[`static bool SPPoint3DAlmostEqualToPoint(SPPoint3D p1, SPPoint3D p2, double tolerance);`](/documentation/Spatial/SPPoint3DAlmostEqualToPoint-9vk02)

Returns a Boolean value that indicates whether the two points are equal within the specified default absolute tolerance.

[`static bool SPPoint3DEqualToPoint(SPPoint3D point1, SPPoint3D point2);`](/documentation/Spatial/SPPoint3DEqualToPoint)

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

### Applying arithmetic operations

[`static func * (Point3D, Double) -> Point3D`](/documentation/Spatial/Point3D/*(_:_:)-9rqvh)

Returns a point that’s the product of a point and a scalar value.

[`static func * (Double, Point3D) -> Point3D`](/documentation/Spatial/Point3D/*(_:_:)-9w7dk)

Returns a point that’s the product of a scalar value and a point.

[`static func * (AffineTransform3D, Point3D) -> Point3D`](/documentation/Spatial/Point3D/*(_:_:)-8ewep)

Returns the point that results from applying the affine transform to the point.

[`static func * (ProjectiveTransform3D, Point3D) -> Point3D`](/documentation/Spatial/Point3D/*(_:_:)-9ak06)

Returns the point that results from applying the projective transform to the point.

[`static func * (Pose3D, Point3D) -> Point3D`](/documentation/Spatial/Point3D/*(_:_:)-8wgkb)

Returns a new point after applying the pose to the point.

[`static func + (Point3D, Size3D) -> Point3D`](/documentation/Spatial/Point3D/+(_:_:)-5v6x4)

Returns a point that’s the element-wise sum of a point and a size.

[`static func + (Size3D, Point3D) -> Point3D`](/documentation/Spatial/Point3D/+(_:_:)-4g55)

Returns a point that’s the element-wise sum of a size and a point.

[`static func - (Point3D) -> Point3D`](/documentation/Spatial/Point3D/-(_:))

Returns a point that’s the element-wise negation of the point.

[`static func - (Point3D, Size3D) -> Point3D`](/documentation/Spatial/Point3D/-(_:_:)-6om9g)

Returns a point that’s the element-wise difference of a point and a size.

[`static func - (Point3D, Point3D) -> Vector3D`](/documentation/Spatial/Point3D/-(_:_:)-9l6rn)

Returns a point that’s the element-wise difference of two points.

[`static func - (Size3D, Point3D) -> Point3D`](/documentation/Spatial/Point3D/-(_:_:)-5t01r)

Returns a point that’s the element-wise difference of a size and a point.

[`static func += (inout Point3D, Vector3D)`](/documentation/Spatial/Point3D/+=(_:_:)-80hjz)

Adds a point and a vector, and stores the result in the left-hand-side variable.

[`static func += (inout Point3D, Size3D)`](/documentation/Spatial/Point3D/+=(_:_:)-3v0zk)

Adds a point and a size, and stores the result in the left-hand-side variable.

[`static func -= (inout Point3D, Vector3D)`](/documentation/Spatial/Point3D/-=(_:_:)-23bow)

Subtracts a vector from a point and stores the difference in the left-hand-side variable.

[`static func -= (inout Point3D, Size3D)`](/documentation/Spatial/Point3D/-=(_:_:)-9xu2)

Subtracts a vector from a point and stores the difference in the left-hand-side variable.

[`static func *= (inout Point3D, Double)`](/documentation/Spatial/Point3D/*=(_:_:))

Multiplies a point and a double-precision value, and stores the result in the left-hand-side variable.

[`static func / (Point3D, Double) -> Point3D`](/documentation/Spatial/Point3D/_(_:_:))

Returns a point with each element divided by a scalar value.

[`static func /= (inout Point3D, Double)`](/documentation/Spatial/Point3D/_=(_:_:))

Divides a point by a scalar value and stores the result in the left-hand-side variable.

### Deprecated symbols

[`func rotation(to: Point3D) -> Rotation3D`](/documentation/Spatial/Point3D/rotation(to:))

Returns the rotation around the origin from the first point to the second point.

[`var origin: Point3D`](/documentation/Spatial/Point3D/origin)

[`var simd: simd_double3`](/documentation/Spatial/Point3D/simd)

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

[`static SPPoint3D SPPoint3DGetOrigin(SPPoint3D point);`](/documentation/Spatial/SPPoint3DGetOrigin)

The location of the point.

[`static SPPoint3D SPPoint3DTranslate(SPPoint3D point, SPSize3D offset);`](/documentation/Spatial/SPPoint3DTranslate-8xo6b)

Returns a point with an origin that’s offset by the specified size.

### Initializers

[`init(Point3DFloat)`](/documentation/Spatial/Point3D/init(_:)-7wgtj)

Returns a double-precision point from a single-precision point.

[`init(simd_packed_double4)`](/documentation/Spatial/Point3D/init(_:)-8r7om)

Creates a Spatial point from a simd packed vector.

### Default Implementations

[Animatable Implementations](/documentation/Spatial/Point3D/Animatable-Implementations)

[ClampableWithinRectProtocol Implementations](/documentation/Spatial/Point3D/ClampableWithinRectProtocol-Implementations)

[CustomReflectable Implementations](/documentation/Spatial/Point3D/CustomReflectable-Implementations)

[Decodable Implementations](/documentation/Spatial/Point3D/Decodable-Implementations)

[Encodable Implementations](/documentation/Spatial/Point3D/Encodable-Implementations)

[Equatable Implementations](/documentation/Spatial/Point3D/Equatable-Implementations)

[Hashable Implementations](/documentation/Spatial/Point3D/Hashable-Implementations)

[Primitive3D Implementations](/documentation/Spatial/Point3D/Primitive3D-Implementations)

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Hashable`](/documentation/Swift/Hashable)

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

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

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

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

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

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

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

[`Escapable`](/documentation/Swift/Escapable)

[`Encodable`](/documentation/Swift/Encodable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

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

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

[`CustomReflectable`](/documentation/Swift/CustomReflectable)

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

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Animatable`](/documentation/SwiftUI/Animatable)

---

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)