Symbols: 50.6% of Apple's iOS API (652 of 1289, exact) · Rows: 11: 8 ✅ 3 ❌ · iOS: 16.0+
Area: Imaging, photos & ML · Apple: Spatial · Issues: area:ml
- Adapted: Spatial's double-precision geometry as pure Swift over simd (
isim/swift/overlays/Spatial/): the same math as Apple's, with these conventions where Apple's documentation leaves them open:- matrices are column-major on column vectors, so
a * bappliesbfirst; rotating, scaling, shearing, flipping or translating a transform (rotated(by:),scaledBy(x:y:z:), …) applies that change after it; - Euler angles are extrinsic:
.xyz(pitchYawRoll) turns about x, then y, then z;.zxyabout z, x, then y; - looking along a direction (
Rotation3D(forward:up:),Pose3D(position:target:up:)) turns +z toward it; - perspective projections are right-handed (the camera looks down -z) with depth 0...1 (1...0 with
reverseZ); - a box that is rotated, sheared or transformed becomes the axis-aligned box around its transformed corners.
- matrices are column-major on column vectors, so
- C and Objective-C:
<Spatial/Spatial.h>(Spatial.framework) is header-only like Apple's: theSP…types are unions and structs over the simd types, and the functions arestatic inlineand overloadable, so there is nothing to link. They follow the Swift overlay's conventions above; the declarations are hidden from Swift, which uses the overlay. The header is generated byisim/tools/spatial-headers.py(the…Floatfunctions it keeps are listed inisim/data/spatial-float-names.txt). Angle2D,Rotation3DandRotationAxis3Dfirst came for Charts' 3D charts;Rotation3Dnow stores a quaternion and keeps itsangle/axisaccessors.
| API / feature | Status | iOS | Notes |
|---|---|---|---|
Angle2D (degrees / radians, normalized, the inverse trigonometric constructors, arithmetic), sin / cos / tan / sinh / cosh / tanh of an angle |
✅ | ≤17 | adapted. Tested (SpatialTest: test_spatial) |
Point3D, Vector3D (dot, cross, projected, reflected, lerp, smoothstep, forward / right / up), Size3D (Volumetric), RotationAxis3D, SphericalCoordinates3D (iOS 18) |
✅ | ≤17 | adapted: transforms apply to points whole (projective ones divide by w) and to vectors and sizes by their linear part. Tested (SpatialTest) |
Rotation3D (a quaternion: init(angle:axis:), init(quaternion:), init(eulerAngles:), init(forward:up:), init(position:target:up:), angle, axis, vector, inverse, *, slerp(from:to:t:along:), spline(…), swingTwist(twistAxis:), eulerAngles(order:), isApproximatelyEqual(to:tolerance:), Codable), EulerAngles, EulerAngles.Order (__SPEulerAngleOrder) |
✅ | ≤17 | adapted (extrinsic Euler angles; SlerpPath.automatic takes the shorter arc). Tested (SpatialTest) |
Rect3D (init(points:), min / max / center / minX …, cornerPoints, standardized, integral, contains, union, intersection, intersects, distance(to:), inset(by:)), Ray3D (intersects(_:) a box, intersects(sphereOrigin:sphereRadius:)) |
✅ | ≤17 | adapted: rays hit only ahead of their origin; transformed boxes are the bounding boxes of their corners. Tested (SpatialTest) |
AffineTransform3D (scale / rotation / translation / shear initializers, 4x4 conversions, init(truncating:), scale, rotation, translation, inverse, isUniform(overDimensions:), changeBasis(from:to:), flipped(along:)), ProjectiveTransform3D (perspective initializers with reverseZ, the frustum tangents, isAffine, is3DProjection(), scaleComponent) |
✅ | ≤17 | adapted: rotation is nil when the transform shears, scale negates x for a reflection. Tested (SpatialTest) |
Pose3D, ScaledPose3D (iOS 18): look-at initializers, conversion from transforms (failing when they scale or shear), inverse, * / concatenating(_:), flipped(along:), matrix |
✅ | ≤17 | adapted: a * b and a.concatenating(b) apply b first. Tested (SpatialTest) |
Primitive3D, Rotatable3D, Scalable3D, Shearable3D, Translatable3D, Volumetric (with their mutating forms), Axis3D, Dimension3DSet, AxisWithFactors |
✅ | ≤17 | adapted. Tested (SpatialTest) |
The single-precision types (Point3DFloat, Rotation3DFloat, …), the *Protocol protocols, SpatialTypeProtocol, CoordinateSpace3D and the world reference space; columns, init(simd_packed_double4) and the iOS 26 Float conversions |
❌ | 26.0 | not implemented: iOS 26's generic layer over the same math |
applying(_:) a projective transform to Rotation3D and Pose3D |
❌ | 27.0 | not implemented |
init(_:) of RealityKit's Transform and BoundingBox |
❌ | 18.0 | not implemented: RealityKit's types are not Spatial's |
The C API: the SP…3D types and their …Float forms (iOS 26), the constants (SP…Zero, …Identity, …Invalid, …) and the SP… inline functions (making, getting, comparing, rotating, scaling, shearing, translating, applying and unapplying transforms and poses, SPRotation3DSlerp / Spline, look-at, Euler angles, boxes, rays, spherical coordinates, conversions between precisions) |
✅ | ≤17 | adapted: header-only <Spatial/Spatial.h> over <simd/simd.h>, generated by isim/tools/spatial-headers.py, the same math as the Swift overlay; every name Apple documents (606). Tested (SpatialCTest against SpatialSwiftTest: test_spatial_c_matches_swift) |
637 symbols Apple documents for iOS that isim does not have (exact; Apple snapshot 2026-10-14). Each links to Apple's documentation.
List
var columns: (Vector3D, Vector3D, Vector3D, Vector3D)AffineTransform3DFloatstatic func * (AffineTransform3DFloat, AffineTransform3DFloat) -> AffineTransform3DFloatstatic func *= (inout AffineTransform3DFloat, AffineTransform3DFloat)static func == (AffineTransform3DFloat, AffineTransform3DFloat) -> Boolfunc changeBasis(from: AffineTransform3DFloat, to: AffineTransform3DFloat) -> AffineTransform3DFloat?var columns: (Vector3DFloat, Vector3DFloat, Vector3DFloat, Vector3DFloat)var customMirror: Mirrorfunc encode(to: any Encoder) throwsfunc flip(along: Axis3D)func flipped(along: Axis3D) -> AffineTransform3DFloatfunc hash(into: inout Hasher)init()init()init(AffineTransform3D)init(simd_double4x3)init(simd_float4x3)init(from: any Decoder) throwsinit(matrix: simd_float4x3)init(pose: Pose3DFloat)init(scale: Size3DFloat, rotation: Rotation3DFloat, translation: Vector3DFloat)init(scaledPose: ScaledPose3DFloat)init(shear: AxisWithFactorsFloat)init(truncating: ProjectiveTransform3DFloat)init(truncating: simd_double4x4)init(truncating: simd_float4x4)var inverse: AffineTransform3DFloat?func isApproximatelyEqual(to: AffineTransform3DFloat, tolerance: Float) -> Boolvar isInvertible: Boolfunc isUniform(overDimensions: Dimension3DSet) -> Boolvar matrix: simd_float4x3var matrix3x3: simd_float3x3var matrix4x4: simd_float4x4var rotation: Rotation3DFloat?var scale: Size3DFloatfunc scaledBy(x: Float, y: Float, z: Float) -> AffineTransform3DFloatfunc sheared(AxisWithFactorsFloat) -> AffineTransform3DFloatvar translation: Vector3DFloatinit(Angle2DFloat)Angle2DFloatstatic func + (Angle2DFloat) -> Angle2DFloatstatic func + (Angle2DFloat, Angle2DFloat) -> Angle2DFloatstatic func += (inout Angle2DFloat, Angle2DFloat)static func - (Angle2DFloat) -> Angle2DFloatstatic func - (Angle2DFloat, Angle2DFloat) -> Angle2DFloatstatic func -= (inout Angle2DFloat, Angle2DFloat)static func == (Angle2DFloat, Angle2DFloat) -> Boolstatic func < (Angle2DFloat, Angle2DFloat) -> Boolstatic func acos(Float) -> Angle2DFloatstatic func acosh(Float) -> Angle2DFloatstatic func asin(Float) -> Angle2DFloatstatic func asinh(Float) -> Angle2DFloatstatic func atan(Float) -> Angle2DFloatstatic func atan2(y: Float, x: Float) -> Angle2DFloatstatic func atanh(Float) -> Angle2DFloatvar customMirror: Mirrorvar degrees: Floatstatic func degrees(Float) -> Angle2DFloatfunc encode(to: any Encoder) throwsfunc hash(into: inout Hasher)init()init(Angle2D)init<T>(degrees: T)init(degrees: Float)init(from: any Decoder) throwsinit(radians: Float)init<T>(radians: T)init(radians: Float)var normalized: Angle2DFloatvar radians: Floatstatic func radians(Float) -> Angle2DFloatAxisWithFactorsFloatcase xAxis(yShearFactor: Float, zShearFactor: Float)case yAxis(xShearFactor: Float, zShearFactor: Float)case zAxis(xShearFactor: Float, yShearFactor: Float)ClampableWithinRectProtocolfunc clamp(to: Self.Rect)func clamp(to: Self.Rect)func clamped(to: Self.Rect) -> SelfCoordinateSpace3DAncestorCoordinateSpacefunc ancestorFromSpaceTransform() throws -> ProjectiveTransform3Dfunc ancestorFromSpaceTransform() throws -> ProjectiveTransform3Dvar ancestorSpace: Self.AncestorCoordinateSpace?func convert<T>(value: T, from: Self) throws -> Tfunc convert<T, Space>(value: T, from: Space) throws -> Tfunc convert<T, Space>(value: T, to: Space) throws -> Tfunc convert<T>(value: T, to: Self) throws -> Tfunc transform(from: Self) throws -> ProjectiveTransform3Dfunc transform(from: Self) throws -> ProjectiveTransform3Dfunc transform<Space>(from: Space) throws -> ProjectiveTransform3Dfunc transform<Space>(from: Space) throws -> ProjectiveTransform3DFloatfunc transformSpace((Self) -> ProjectiveTransform3D) -> some CoordinateSpace3Dstatic var worldReference: WorldReferenceCoordinateSpaceCoordinateSpace3DFloatfunc ancestorFromSpaceTransformFloat() throws -> ProjectiveTransform3DFloatfunc convert<T, Space>(value: T, from: Space) throws -> Tfunc convert<T, Space>(value: T, to: Space) throws -> Tfunc transformSpace((Self) -> ProjectiveTransform3DFloat) -> some CoordinateSpace3DFloatCoordinateSpaceValue3Dfunc resolve<Space>(in: Space) throws -> Self.ValueValueEulerAnglesFloatvar angles: simd_float3init()init(angles: simd_float3, order: __SPEulerAngleOrder)init(x: Angle2DFloat, y: Angle2DFloat, z: Angle2DFloat, order: EulerAngles.Order)var order: __SPEulerAngleOrderPoint3DFloatstatic func * (Pose3DFloat, Point3DFloat) -> Point3DFloatstatic func * (ProjectiveTransform3DFloat, Point3DFloat) -> Point3DFloatstatic func * (AffineTransform3DFloat, Point3DFloat) -> Point3DFloatstatic func * (Float, Point3DFloat) -> Point3DFloatstatic func * (Point3DFloat, Float) -> Point3DFloatstatic func *= (inout Point3DFloat, Float)static func + (Size3DFloat, Point3DFloat) -> Point3DFloatstatic func + (Point3DFloat, Size3DFloat) -> Point3DFloatstatic func += (inout Point3DFloat, Vector3DFloat)static func += (inout Point3DFloat, Size3DFloat)static func - (Point3DFloat) -> Point3DFloatstatic func - (Size3DFloat, Point3DFloat) -> Point3DFloatstatic func - (Point3DFloat, Point3DFloat) -> Vector3DFloatstatic func - (Point3DFloat, Size3DFloat) -> Point3DFloatstatic func -= (inout Point3DFloat, Size3DFloat)static func -= (inout Point3DFloat, Vector3DFloat)static func == (Point3DFloat, Point3DFloat) -> Boolstatic func / (Point3DFloat, Float) -> Point3DFloatstatic func /= (inout Point3DFloat, Float)func applying(ScaledPose3DFloat) -> Point3DFloatfunc applying(Pose3DFloat) -> Point3DFloatvar customMirror: Mirrorfunc distance(to: Point3DFloat) -> Floatfunc encode(to: any Encoder) throwsfunc hash(into: inout Hasher)init()init(Size3DFloat)init(Vector3DFloat)init(simd_packed_float4)init(simd_double3)init(Point3D)init(SphericalCoordinates3DFloat)init(simd_float3)init(from: any Decoder) throwsinit(vector: simd_float3)init<T>(x: T, y: T, z: T)init(x: Float, y: Float, z: Float)func isApproximatelyEqual(to: Point3DFloat, tolerance: Float) -> Boolfunc rotated(by: simd_quatf, around: Point3DFloat) -> Point3DFloatfunc rotated(by: Rotation3DFloat, around: Point3DFloat) -> Point3DFloatfunc unapplying(Pose3DFloat) -> Point3DFloatfunc unapplying(ScaledPose3DFloat) -> Point3DFloatvar vector: simd_float3var x: Floatvar y: Floatvar z: Floatfunc applying(ProjectiveTransform3D) -> Pose3DPose3DFloatstatic func * (Pose3DFloat, Pose3DFloat) -> Pose3DFloatstatic func *= (inout Pose3DFloat, Pose3DFloat)static func == (Pose3DFloat, Pose3DFloat) -> Boolfunc applying(ProjectiveTransform3DFloat) -> Pose3DFloatfunc concatenating(Pose3DFloat) -> Pose3DFloatfunc concatenating(ScaledPose3DFloat) -> ScaledPose3DFloatvar customMirror: Mirrorfunc encode(to: any Encoder) throwsfunc flip(along: Axis3D)func flipped(along: Axis3D) -> Pose3DFloatfunc hash(into: inout Hasher)static var identity: Pose3DFloatinit()init?(simd_float4x4)init(Pose3D)init(forward: Vector3DFloat, up: Vector3DFloat)init(from: any Decoder) throwsinit(position: simd_float3, rotation: simd_quatf)init(position: Point3DFloat, rotation: Rotation3DFloat)init(position: Point3DFloat, rotation: Rotation3DFloat)init(position: Point3DFloat, target: Point3DFloat, up: Vector3DFloat)init?(transform: AffineTransform3DFloat)init?(transform: ProjectiveTransform3DFloat)var inverse: Pose3DFloatfunc isApproximatelyEqual(to: Pose3DFloat, tolerance: Float) -> Boolvar isIdentity: Boolvar matrix: simd_float4x4var position: Point3DFloatfunc rotated(by: Rotation3DFloat) -> Pose3DFloatfunc rotated(by: simd_quatf) -> Pose3DFloatvar rotation: Rotation3DFloatPrimitive3DProtocolfunc apply(Self.Pose)func apply(Self.ProjectiveTransform)func apply(Self.AffineTransform)func apply(Self.ProjectiveTransform)func apply(Self.Pose)func apply(Self.AffineTransform)func applying(Self.AffineTransform) -> Selffunc applying(Self.Pose) -> Selffunc applying(Self.ProjectiveTransform) -> Selfstatic var infinity: Selfvar isFinite: Boolvar isNaN: Boolvar isZero: Boolfunc unapply(Self.ProjectiveTransform)func unapply(Self.Pose)func unapply(Self.AffineTransform)func unapply(Self.AffineTransform)func unapply(Self.ProjectiveTransform)func unapply(Self.Pose)func unapplying(Self.ProjectiveTransform) -> Selffunc unapplying(Self.AffineTransform) -> Selffunc unapplying(Self.Pose) -> Selfstatic var zero: Selfinit(fovY: Angle2D, aspectRatio: Double, nearZ: Double, farZ: Double)init(fovyRadians: Double, aspectRatio: Double, nearZ: Double, farZ: Double)ProjectiveTransform3DFloatstatic func * (ProjectiveTransform3DFloat, ProjectiveTransform3DFloat) -> ProjectiveTransform3DFloatstatic func *= (inout ProjectiveTransform3DFloat, ProjectiveTransform3DFloat)var customMirror: Mirrorfunc flip(along: Axis3D)func flipped(along: Axis3D) -> ProjectiveTransform3DFloatinit()init()init(simd_double4x4)init(simd_float4x4)init(AffineTransform3DFloat)init(ProjectiveTransform3D)init(fovY: Angle2DFloat, aspectRatio: Float, nearZ: Float, farZ: Float)init(fovY: Angle2DFloat, aspectRatio: Float, nearZ: Float, farZ: Float, reverseZ: Bool)init(leftTangent: Float, rightTangent: Float, topTangent: Float, bottomTangent: Float, nearZ: Float, farZ: Float, reverseZ: Bool)init(matrix: simd_float4x4)init(pose: Pose3DFloat)init(scale: Size3DFloat, rotation: Rotation3DFloat, translation: Vector3DFloat)init(scaledPose: ScaledPose3DFloat)init(shear: AxisWithFactorsFloat)var inverse: ProjectiveTransform3DFloat?func is3DFloatProjection() -> Boolvar isAffine: Boolfunc isApproximatelyEqual(to: ProjectiveTransform3DFloat, tolerance: Float) -> Boolvar isInvertible: Boolfunc isUniform(overDimensions: Dimension3DSet) -> Boolvar matrix: simd_float4x4var rotation: Rotation3DFloat?var scaleComponent: Size3DFloatfunc scaledBy(x: Float, y: Float, z: Float) -> ProjectiveTransform3DFloatfunc sheared(AxisWithFactorsFloat) -> ProjectiveTransform3DFloatvar translation: Vector3DFloatProjectiveTransformable3Dfunc applying(ProjectiveTransform3D) -> Selffunc applying(ProjectiveTransform3D) -> SelfProjectiveTransformable3DFloatfunc applying(ProjectiveTransform3DFloat) -> Selfinit(Ray3DFloat)Ray3DFloatstatic func * (Pose3DFloat, Ray3DFloat) -> Ray3DFloatstatic func == (Ray3DFloat, Ray3DFloat) -> Boolfunc apply(Pose3DFloat)func applying(Pose3DFloat) -> Ray3DFloatfunc applying(ProjectiveTransform3DFloat) -> Ray3DFloatfunc applying(AffineTransform3DFloat) -> Ray3DFloatfunc applying(ScaledPose3DFloat) -> Ray3DFloatvar customMirror: Mirrorvar direction: Vector3DFloatfunc encode(to: any Encoder) throwsfunc hash(into: inout Hasher)init()init(Ray3D)init(from: any Decoder) throwsinit(origin: Point3DFloat, direction: Vector3DFloat)init(origin: Point3DFloat, direction: Vector3DFloat)init(origin: simd_float3, direction: simd_float3)func intersects(Rect3DFloat) -> Boolfunc intersects(sphereOrigin: Point3DFloat, sphereRadius: Float) -> Boolvar isFinite: Boolvar isNaN: Boolvar isZero: Boolvar origin: Point3DFloatfunc rotated(by: simd_quatf) -> Ray3DFloatfunc rotated(by: Rotation3DFloat) -> Ray3DFloatfunc rotated(by: simd_quatf, around: Point3DFloat) -> Ray3DFloatfunc rotated(by: Rotation3DFloat, around: Point3DFloat) -> Ray3DFloatfunc unapplying(Pose3DFloat) -> Ray3DFloatfunc unapplying(ScaledPose3DFloat) -> Ray3DFloatfunc unapplying(ProjectiveTransform3DFloat) -> Ray3DFloatfunc unapplying(AffineTransform3DFloat) -> Ray3DFloatinit(Rect3DFloat)init(BoundingBox)Rect3DFloatstatic func * (ProjectiveTransform3DFloat, Rect3DFloat) -> Rect3DFloatstatic func * (Pose3DFloat, Rect3DFloat) -> Rect3DFloatstatic func * (AffineTransform3DFloat, Rect3DFloat) -> Rect3DFloatstatic func == (Rect3DFloat, Rect3DFloat) -> Boolfunc applying(ScaledPose3DFloat) -> Rect3DFloatfunc applying(Pose3DFloat) -> Rect3DFloatvar center: Point3DFloatfunc contains(anyOf: [Point3DFloat]) -> Boolvar cornerPoints: [Point3DFloat]var customMirror: Mirrorfunc encode(to: any Encoder) throwsfunc formInset(by: Size3DFloat)func hash(into: inout Hasher)- … and 337 more (
isim/data/api-coverage.json.gz)