Structures
The following structures are available globally.
-
Represents a 2D arc of a circle as a center, radius, and start+sweep angles.
See moreDeclaration
Swift
public struct CircleArc2<Vector> : GeometricType, CustomStringConvertible where Vector : Vector2Real
extension CircleArc2: LineIntersectableType
extension CircleArc2: Equatable where Vector: Equatable
extension CircleArc2: Hashable where Vector: Hashable
-
Represents a 2D edge inset as relative inset values for each of the four edges of a rectangular 2D perimeter.
See moreDeclaration
Swift
public struct EdgeInsets2<Vector> where Vector : Vector2Type
extension EdgeInsets2: Equatable where Vector: Equatable, Scalar: Equatable
extension EdgeInsets2: Hashable where Vector: Hashable, Scalar: Hashable
extension EdgeInsets2: Encodable where Vector: Encodable, Scalar: Encodable
extension EdgeInsets2: Decodable where Vector: Decodable, Scalar: Decodable
-
Describes the result of a line-line intersection query on two
Line2FloatingPoint
.Seealso
intersection(with:)
Declaration
Swift
public struct LineIntersectionResult<Vector> where Vector : VectorFloatingPoint
extension LineIntersectionResult: Equatable where Vector: Equatable
extension LineIntersectionResult: Hashable where Vector: Hashable
-
A two-component vector type
See moreDeclaration
Swift
public struct Vector2<Scalar> : Vector2Type
extension Vector2: Equatable where Scalar: Equatable
extension Vector2: Hashable where Scalar: Hashable
extension Vector2: Encodable where Scalar: Encodable
extension Vector2: Decodable where Scalar: Decodable
extension Vector2: VectorComparable where Scalar: Comparable
extension Vector2: AdditiveArithmetic where Scalar: AdditiveArithmetic
extension Vector2: VectorAdditive where Scalar: AdditiveArithmetic
extension Vector2: Vector2Additive where Scalar: AdditiveArithmetic
extension Vector2: VectorMultiplicative where Scalar: Numeric
extension Vector2: Vector2Multiplicative where Scalar: Numeric
extension Vector2: VectorSigned where Scalar: SignedNumeric & Comparable
extension Vector2: Vector2Signed where Scalar: SignedNumeric & Comparable
extension Vector2: VectorDivisible where Scalar: DivisibleArithmetic
extension Vector2: VectorFloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector2: SignedDistanceMeasurableType where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector2: Vector2FloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector2: VectorReal where Scalar: DivisibleArithmetic & Real
extension Vector2: Vector2Real where Scalar: DivisibleArithmetic & Real
-
Declaration
Swift
public struct Cylinder3<Vector> : GeometricType where Vector : Vector3Type
extension Cylinder3: Equatable where Vector: Equatable, Scalar: Equatable
extension Cylinder3: Hashable where Vector: Hashable, Scalar: Hashable
extension Cylinder3: BoundableType where Vector: Vector3FloatingPoint
extension Cylinder3: VolumetricType where Vector: Vector3FloatingPoint
extension Cylinder3: PointProjectableType where Vector: Vector3FloatingPoint
extension Cylinder3: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension Cylinder3: Convex3Type where Vector: Vector3Real
-
Represents a 3-dimensional flat disk as a center point, normal, and radius.
A disk can be interpreted as a clipped plane, where the only points contained within the plane are the ones
See more<=
radius
distance from the center.Declaration
Swift
public struct Disk3<Vector> : GeometricType where Vector : Vector3FloatingPoint
extension Disk3: BoundableType
extension Disk3: PointProjectableType
extension Disk3: SignedDistanceMeasurableType
extension Disk3: LineIntersectablePlaneType
extension Disk3: Equatable where Vector: Equatable
extension Disk3: Hashable where Vector: Hashable
-
Coordinates on a sphere projective space.
See moreDeclaration
Swift
public struct SphereCoordinates<Scalar> : Equatable where Scalar : Real
-
A point-normal plane with a separate up and right vector used to control projection on the axis of the plane and compute the local X and Y axis.
See moreDeclaration
Swift
public struct ProjectivePointNormalPlane3<Vector> : PointProjectablePlaneType where Vector : Vector3FloatingPoint
extension ProjectivePointNormalPlane3: ProjectiveSpace
extension ProjectivePointNormalPlane3: PlaneProjectiveSpace
extension ProjectivePointNormalPlane3: Equatable where Vector: Equatable
extension ProjectivePointNormalPlane3: Hashable where Vector: Hashable
-
Represents a three dimensional torus shape as a center point, an axis of rotation around that center point, and two radii describing the radius of a circle, and the radius of the axis of rotation of the circle around the center point of the torus.
See moreDeclaration
Swift
public struct Torus3<Vector> : GeometricType where Vector : Vector3FloatingPoint
extension Torus3: BoundableType
extension Torus3: VolumetricType
extension Torus3: PointProjectableType
extension Torus3: Equatable where Vector: Equatable, Scalar: Equatable
extension Torus3: Hashable where Vector: Hashable, Scalar: Hashable
extension Torus3: SignedDistanceMeasurableType where Vector.Scalar: Real
-
A three-component vector type
See moreDeclaration
Swift
public struct Vector3<Scalar> : Vector3Type
extension Vector3: Equatable where Scalar: Equatable
extension Vector3: Hashable where Scalar: Hashable
extension Vector3: Encodable where Scalar: Encodable
extension Vector3: Decodable where Scalar: Decodable
extension Vector3: VectorComparable where Scalar: Comparable
extension Vector3: AdditiveArithmetic where Scalar: AdditiveArithmetic
extension Vector3: VectorAdditive where Scalar: AdditiveArithmetic
extension Vector3: VectorMultiplicative where Scalar: Numeric
extension Vector3: Vector3Additive where Scalar: AdditiveArithmetic
extension Vector3: Vector3Multiplicative where Scalar: Numeric
extension Vector3: VectorSigned where Scalar: SignedNumeric & Comparable
extension Vector3: VectorDivisible where Scalar: DivisibleArithmetic
extension Vector3: VectorFloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector3: SignedDistanceMeasurableType where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector3: Vector3FloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector3: VectorReal where Scalar: DivisibleArithmetic & Real
extension Vector3: Vector3Real where Scalar: DivisibleArithmetic & Real
-
A four-component vector type
See moreDeclaration
Swift
public struct Vector4<Scalar> : Vector4Type
extension Vector4: Equatable where Scalar: Equatable
extension Vector4: Hashable where Scalar: Hashable
extension Vector4: Encodable where Scalar: Encodable
extension Vector4: Decodable where Scalar: Decodable
extension Vector4: VectorComparable where Scalar: Comparable
extension Vector4: AdditiveArithmetic where Scalar: AdditiveArithmetic
extension Vector4: VectorAdditive where Scalar: AdditiveArithmetic
extension Vector4: VectorMultiplicative where Scalar: Numeric
extension Vector4: Vector4Additive where Scalar: AdditiveArithmetic
extension Vector4: VectorSigned where Scalar: SignedNumeric & Comparable
extension Vector4: VectorDivisible where Scalar: DivisibleArithmetic
extension Vector4: VectorFloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector4: SignedDistanceMeasurableType where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector4: Vector4FloatingPoint where Scalar: DivisibleArithmetic & FloatingPoint
extension Vector4: VectorReal where Scalar: DivisibleArithmetic & Real
-
A standardized representation of an angle.
See moreDeclaration
Swift
public struct Angle<Scalar> : Hashable, CustomStringConvertible where Scalar : ElementaryFunctions, Scalar : FloatingPoint
extension Angle: AdditiveArithmetic
extension Angle: Numeric
extension Angle: Encodable where Scalar: Encodable
extension Angle: Decodable where Scalar: Decodable
-
A pair of angle + angle range values that can be used to test inclusivity of
See moreAngle<Scalar>
values.Declaration
Swift
public struct AngleSweep<Scalar> : Hashable where Scalar : ElementaryFunctions, Scalar : FloatingPoint
-
Represents an axis-aligned bounding box with two N-dimensional vectors that describe the minimal and maximal coordinates of the box’s opposite corners.
See moreDeclaration
Swift
public struct AABB<Vector> : GeometricType where Vector : VectorType
extension AABB: BoundableType
extension AABB: Equatable where Vector: Equatable, Scalar: Equatable
extension AABB: Hashable where Vector: Hashable, Scalar: Hashable
extension AABB: Encodable where Vector: Encodable, Scalar: Encodable
extension AABB: Decodable where Vector: Decodable, Scalar: Decodable
extension AABB: VolumetricType where Vector: VectorComparable
extension AABB: SelfIntersectableRectangleType where Vector: VectorAdditive & VectorComparable
extension AABB: RectangleType & ConstructableRectangleType & AdditiveRectangleType where Vector: VectorAdditive
extension AABB: DivisibleRectangleType where Vector: VectorDivisible & VectorComparable
extension AABB: ConvexType where Vector: VectorFloatingPoint
extension AABB: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
-
Represents an N-dimensional geometric ray which projects a line from a starting point in a specified direction to infinity.
See moreDeclaration
Swift
public struct DirectionalRay<Vector> : GeometricType where Vector : VectorFloatingPoint
extension DirectionalRay: LineType
extension DirectionalRay: Equatable where Vector: Equatable, Scalar: Equatable
extension DirectionalRay: Hashable where Vector: Hashable, Scalar: Hashable
extension DirectionalRay: Encodable where Vector: Encodable, Scalar: Encodable
extension DirectionalRay: Decodable where Vector: Decodable, Scalar: Decodable
extension DirectionalRay: LineAdditive where Vector: VectorAdditive
extension DirectionalRay: LineMultiplicative where Vector: VectorMultiplicative
extension DirectionalRay: LineSigned where Vector: VectorSigned
extension DirectionalRay: LineFloatingPoint & PointProjectableType & SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension DirectionalRay: LineReal where Vector: VectorReal
-
Represents an N-dimensional ellipsoid as a center with an N-dimensional radii vector which describes the axis of the ellipsoid.
See moreDeclaration
Swift
public struct Ellipsoid<Vector> : GeometricType where Vector : VectorType
extension Ellipsoid: Equatable where Vector: Equatable, Scalar: Equatable
extension Ellipsoid: Hashable where Vector: Hashable, Scalar: Hashable
extension Ellipsoid: Encodable where Vector: Encodable, Scalar: Encodable
extension Ellipsoid: Decodable where Vector: Decodable, Scalar: Decodable
extension Ellipsoid: BoundableType where Vector: VectorAdditive
extension Ellipsoid: VolumetricType where Vector: VectorReal
extension Ellipsoid: ConvexType where Vector: VectorReal
-
Represents a hyperplane with a point and a normal.
The dimensions of the surface of the hyperplane have a codimension of 1 with respect to its ambient space; in 2D, a hyperplane equates to a line, in 3D it equates to a flat 2D plane, in 4D to a 3D volume, etc.
Hyperplanes divides the space it is contained within, producing an infinitely-spanning volume of space bound at a specific point and angle relative to its ambient space.
See moreDeclaration
Swift
public struct Hyperplane<Vector> : GeometricType, CustomStringConvertible where Vector : VectorFloatingPoint
extension Hyperplane: PlaneType
extension Hyperplane: PointProjectablePlaneType
extension Hyperplane: LineIntersectablePlaneType
extension Hyperplane: ConvexType
extension Hyperplane: VolumetricType
extension Hyperplane: Equatable where Vector: Equatable
extension Hyperplane: Hashable where Vector: Hashable
-
Represents a geometric line as a pair of start and end N-dimensional vectors which describe the two points an infinite line crosses.
See moreDeclaration
Swift
public struct Line<Vector> : LineType where Vector : VectorType
extension Line: Equatable where Vector: Equatable, Scalar: Equatable
extension Line: Hashable where Vector: Hashable, Scalar: Hashable
extension Line: Encodable where Vector: Encodable, Scalar: Encodable
extension Line: Decodable where Vector: Decodable, Scalar: Decodable
extension Line: LineAdditive where Vector: VectorAdditive
extension Line: LineMultiplicative where Vector: VectorMultiplicative
extension Line: LineDivisible where Vector: VectorDivisible
extension Line: LineSigned where Vector: VectorSigned
extension Line: LineFloatingPoint & PointProjectableType & SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension Line: LineReal where Vector: VectorReal
-
The result of a
See moreLineIntersectableType
-line intersection test.Declaration
Swift
public struct LineIntersection<Vector> where Vector : VectorFloatingPoint
extension LineIntersection: Equatable where Vector: Equatable
extension LineIntersection: Hashable where Vector: Hashable
-
Represents a point along with a normal on the surface of a geometry, and an absolute magnitude associated with a line that intersected with that point.
See moreDeclaration
Swift
public struct LineIntersectionPointNormal<Vector> : GeometricType, CustomStringConvertible where Vector : VectorFloatingPoint
extension LineIntersectionPointNormal: Equatable where Vector: Equatable
extension LineIntersectionPointNormal: Hashable where Vector: Hashable
extension LineIntersectionPointNormal: PlaneType where Vector: VectorFloatingPoint
-
Represents a line polygon as a series of connected N-dimensional vertices.
A 2-dimensional line polygon defines a closed polygon, while in higher dimensions it is simply a list of line segments where the ends meet at the vertices.
See moreDeclaration
Swift
public struct LinePolygon<Vector> : GeometricType where Vector : VectorType
extension LinePolygon: Equatable where Vector: Equatable, Scalar: Equatable
extension LinePolygon: Hashable where Vector: Hashable, Scalar: Hashable
extension LinePolygon: Encodable where Vector: Encodable, Scalar: Encodable
extension LinePolygon: Decodable where Vector: Decodable, Scalar: Decodable
extension LinePolygon: BoundableType where Vector: VectorAdditive & VectorComparable
-
Represents a line segment as a pair of start and end N-dimensional vectors which describe a closed interval.
See moreDeclaration
Swift
public struct LineSegment<Vector> : LineType, CustomStringConvertible where Vector : VectorType
extension LineSegment: Equatable where Vector: Equatable, Scalar: Equatable
extension LineSegment: Hashable where Vector: Hashable, Scalar: Hashable
extension LineSegment: Encodable where Vector: Encodable, Scalar: Encodable
extension LineSegment: Decodable where Vector: Decodable, Scalar: Decodable
extension LineSegment: BoundableType where Vector: VectorComparable
extension LineSegment: LineAdditive where Vector: VectorAdditive
extension LineSegment: LineMultiplicative where Vector: VectorMultiplicative
extension LineSegment: LineSigned where Vector: VectorSigned
extension LineSegment: LineDivisible where Vector: VectorDivisible
extension LineSegment: LineFloatingPoint & PointProjectableType & SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension LineSegment: LineReal where Vector: VectorReal
-
Represents an N-dimensional capsule (A Stadium in 2D, and a Capsule in 3D), where all points that are less than
See moreradius
distance away from a line are considered within the geometry.Declaration
Swift
public struct NCapsule<Vector> : GeometricType where Vector : VectorType
extension NCapsule: Equatable where Vector: Equatable, Scalar: Equatable
extension NCapsule: Hashable where Vector: Hashable, Scalar: Hashable
extension NCapsule: BoundableType where Vector: VectorAdditive & VectorComparable
extension NCapsule: VolumetricType where Vector: VectorFloatingPoint
extension NCapsule: PointProjectableType where Vector: VectorFloatingPoint
-
Represents an N-dimensional rectangle with a vector describing its origin and a size vector that describes the span of the rectangle.
See moreDeclaration
Swift
public struct NRectangle<Vector> : ConstructableRectangleType where Vector : VectorType
extension NRectangle: Equatable where Vector: Equatable, Scalar: Equatable
extension NRectangle: Hashable where Vector: Hashable, Scalar: Hashable
extension NRectangle: Encodable where Vector: Encodable, Scalar: Encodable
extension NRectangle: Decodable where Vector: Decodable, Scalar: Decodable
extension NRectangle: AdditiveRectangleType where Vector: VectorAdditive
extension NRectangle: BoundableType where Vector: VectorAdditive
extension NRectangle: VolumetricType where Vector: VectorAdditive & VectorComparable
extension NRectangle: SelfIntersectableRectangleType where Vector: VectorAdditive & VectorComparable
extension NRectangle: DivisibleRectangleType where Vector: VectorDivisible & VectorComparable
extension NRectangle: ConvexType where Vector: VectorFloatingPoint
extension NRectangle: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
-
Represents an N-dimensional sphere with a center point and a radius.
See moreDeclaration
Swift
public struct NSphere<Vector> : GeometricType, CustomStringConvertible where Vector : VectorType
extension NSphere: Equatable where Vector: Equatable, Scalar: Equatable
extension NSphere: Hashable where Vector: Hashable, Scalar: Hashable
extension NSphere: Encodable where Vector: Encodable, Scalar: Encodable
extension NSphere: Decodable where Vector: Decodable, Scalar: Decodable
extension NSphere: BoundableType where Vector: VectorAdditive
extension NSphere: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension NSphere: ConvexType & PointProjectableType where Vector: VectorFloatingPoint
-
Represents an N-dimensional square with an origin point and a scalar value for the side length of each edge.
See moreDeclaration
Swift
public struct NSquare<Vector> : GeometricType where Vector : VectorType
extension NSquare: Equatable where Vector: Equatable, Scalar: Equatable
extension NSquare: Hashable where Vector: Hashable, Scalar: Hashable
extension NSquare: RectangleType & BoundableType where Vector: VectorAdditive
extension NSquare: VolumetricType where Vector: VectorAdditive & VectorComparable
extension NSquare: ConvexType where Vector: VectorFloatingPoint
extension NSquare: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
-
A point-cloud container for discrete sets of points in space.
See moreDeclaration
Swift
public struct PointCloud<Vector> where Vector : VectorType
-
Represents a point along with a normal on the surface of a geometry.
This point-normal pair type has more lax constraints compared to
See morePointNormalPlane
.Declaration
Swift
public struct PointNormal<Vector> : GeometricType, CustomStringConvertible where Vector : VectorFloatingPoint
extension PointNormal: Equatable where Vector: Equatable
extension PointNormal: Hashable where Vector: Hashable
extension PointNormal: PlaneType where Vector: VectorFloatingPoint
-
Represents an infinite plane with a point and a normal.
In 2D, a plane equates to a line, while in 3D and higher dimensions it equates to a flat 2D plane.
See moreDeclaration
Swift
public struct PointNormalPlane<Vector> : GeometricType, CustomStringConvertible where Vector : VectorFloatingPoint
extension PointNormalPlane: PlaneType
extension PointNormalPlane: PointProjectablePlaneType
extension PointNormalPlane: LineIntersectablePlaneType
extension PointNormalPlane: Equatable where Vector: Equatable
extension PointNormalPlane: Hashable where Vector: Hashable
-
Wraps a vector and ensures that assignments are always stored as a unit vector.
If a vector with
See more.length == 0
is attempted to be stored, a zero-valued vector is assigned instead andisValid
returnsfalse
until a new valid vector is supplied.Declaration
Swift
@propertyWrapper public struct UnitVector<Vector> where Vector : VectorFloatingPoint
extension UnitVector: Equatable where Vector: Equatable, Vector.Scalar: Equatable
extension UnitVector: Hashable where Vector: Hashable, Vector.Scalar: Hashable
extension UnitVector: Encodable where Vector: Encodable, Vector.Scalar: Encodable
extension UnitVector: Decodable where Vector: Decodable, Vector.Scalar: Decodable
-
Represents an N-dimensional geometric ray line which has a starting point and crosses a secondary point before projecting to infinity.
See moreDeclaration
Swift
public struct Ray<Vector> : GeometricType where Vector : VectorType
extension Ray: LineType
extension Ray: Equatable where Vector: Equatable, Scalar: Equatable
extension Ray: Hashable where Vector: Hashable, Scalar: Hashable
extension Ray: Encodable where Vector: Encodable, Scalar: Encodable
extension Ray: Decodable where Vector: Decodable, Scalar: Decodable
extension Ray: LineAdditive where Vector: VectorAdditive
extension Ray: LineMultiplicative where Vector: VectorMultiplicative
extension Ray: LineDivisible where Vector: VectorDivisible
extension Ray: LineSigned where Vector: VectorSigned
extension Ray: LineFloatingPoint & PointProjectableType & SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension Ray: LineReal where Vector: VectorReal
-
Represents an N-dimensional rounded rectangle with a rectangle and radius for each axis.
See moreDeclaration
Swift
public struct RoundNRectangle<Vector> : GeometricType where Vector : VectorType
extension RoundNRectangle: Equatable where Vector: Equatable, Scalar: Equatable
extension RoundNRectangle: Hashable where Vector: Hashable, Scalar: Hashable
extension RoundNRectangle: Encodable where Vector: Encodable, Scalar: Encodable
extension RoundNRectangle: Decodable where Vector: Decodable, Scalar: Decodable
extension RoundNRectangle: BoundableType where Vector: VectorAdditive
-
Represents a [triangle] as a trio of N-dimensional vectors which describe a 2-dimensional enclosed surface on an euclidean space.
See moreDeclaration
Swift
public struct Triangle<Vector> : GeometricType where Vector : VectorType
extension Triangle: BoundableType where Vector: VectorComparable
-
Plain 2-row 2-column Matrix with real components.
See moreDeclaration
Swift
public struct Matrix2x2<Scalar> : SquareMatrixType, CustomStringConvertible where Scalar : DivisibleArithmetic, Scalar : Real
-
Plain 3-row 2-column Matrix for 2D affine transformations with floating-point components.
See moreDeclaration
Swift
public struct Matrix3x2<Scalar> : Hashable, CustomStringConvertible where Scalar : ElementaryFunctions, Scalar : FloatingPoint
extension Matrix3x2: Encodable where Scalar: Encodable
extension Matrix3x2: Decodable where Scalar: Decodable
-
Plain 3-row 3-column Matrix with real components.
See moreDeclaration
Swift
public struct Matrix3x3<Scalar> : SquareMatrixType, CustomStringConvertible where Scalar : DivisibleArithmetic, Scalar : Real
-
Plain 4-row 4-column Matrix with real components.
See moreDeclaration
Swift
public struct Matrix4x4<Scalar> : SquareMatrixType, CustomStringConvertible where Scalar : DivisibleArithmetic, Scalar : Real