Protocols
The following protocols are available globally.
-
Protocol for 2D geometric types defined by floating-point vectors that form closed convex shapes.
See moreDeclaration
Swift
public protocol Convex2Type : GeometricType
-
Protocol for geometric types that have an internal volumetric area that can be queried with Vectors for containment checks.
See moreDeclaration
Swift
public protocol VolumetricType : GeometricType
-
Protocol for 2D line types where the vectors are floating-point vectors.
See moreDeclaration
Swift
public protocol Line2FloatingPoint : Line2Signed, LineFloatingPoint where Self.Vector : Vector2FloatingPoint
-
Protocol for 2D line types where the vectors are multiplicative vectors.
Declaration
Swift
public protocol Line2Multiplicative : Line2Type, LineMultiplicative where Self.Vector : Vector2Multiplicative
-
Protocol for 2D line types where the vectors are real vectors.
See moreDeclaration
Swift
public protocol Line2Real : Line2FloatingPoint where Self.Vector : Vector2Real
-
Protocol for 2D line types where the vectors are signed vectors.
See moreDeclaration
Swift
public protocol Line2Signed : Line2Multiplicative, LineSigned where Self.Vector : Vector2Signed
-
A line that is described by two 2-dimensional vectors.
Declaration
Swift
public protocol Line2Type : LineType where Self.Vector : Vector2Type
-
A 1D plane in 2D space that can be intersected with other intersectable planes, producing intersection lines.
A plane-intersectable plane is implicitly a line-intersectable plane as well.
See moreDeclaration
Swift
public protocol PlaneIntersectablePlane2Type : LineIntersectablePlaneType where Self.Vector : Vector2Type
-
Protocol for rectangle geometric types that can be constructed with location and size.
Rectangle types that cannot be constructed with arbitrary location or sizes (e.g.
See moreNSquare
has location but size is restricted to a single side length scalar) should not conform to this protocol, instead use base protocolRectangleType
.Declaration
Swift
public protocol ConstructableRectangleType : RectangleType
-
Protocol refining
RectangleType
withVectorDivisible
extensions.Divisible rectangle types can be split into smaller rectangles, as well as be inflated/inset.
See moreDeclaration
Swift
public protocol DivisibleRectangleType : AdditiveRectangleType where Self.Vector : VectorDivisible
-
Protocol for geometric types defined by vectors that fill enclosed rectangular areas with a defined location and size.
See moreDeclaration
Swift
public protocol RectangleType : GeometricType
-
Protocol for 2D types that support addition and subtraction.
Declaration
Swift
public protocol Vector2Additive : Vector2Type, VectorAdditive where Self.SubVector3 : Vector3Additive
-
Protocol for 2D vector types where the components are floating-point numbers.
See moreDeclaration
Swift
public protocol Vector2FloatingPoint : Vector2Signed, VectorFloatingPoint where Self.SubVector3 : Vector3FloatingPoint
-
Protocol for 2D vector types with multiplicative scalars.
See moreDeclaration
Swift
public protocol Vector2Multiplicative : Vector2Additive, VectorMultiplicative where Self.SubVector3 : Vector3Multiplicative
-
Protocol for 2D real vector types.
See moreDeclaration
Swift
public protocol Vector2Real : Vector2FloatingPoint, VectorReal where Self.SubVector3 : Vector3Real
-
Protocol for 2D vector types where the components are signed numbers.
See moreDeclaration
Swift
public protocol Vector2Signed : Vector2Multiplicative, VectorSigned where Self.SubVector3 : VectorSigned
-
Protocol for types that can represent 2D vectors.
See moreDeclaration
Swift
public protocol Vector2Type : VectorTakeable where Self.TakeDimensions == Vector2TakeDimensions
-
A projective space for 2D planes.
Declaration
Swift
public protocol PlaneProjectiveSpace : ProjectiveSpace where Self.Coordinates : Vector2Type
-
A projected space laying on the surface of a 3-dimensional sphere, with a 2-dimensional underlying space where vectors represent the azimuth (XY angle of the points) and elevation (the angle between the point and the XY-plane on the sphere).
See moreDeclaration
Swift
public protocol SphereProjectiveSpace : ProjectiveSpace where Self.Vector : Vector3Type
-
Protocol for 3D geometric types defined by floating-point vectors that form closed convex shapes.
See moreDeclaration
Swift
public protocol Convex3Type : GeometricType
-
Protocol for general geometric types that can be intersected with 3D lines.
See moreDeclaration
Swift
public protocol Line3IntersectableType : GeometricType
-
Protocol for 3D line types where the vectors are floating-point vectors.
See moreDeclaration
Swift
public protocol Line3FloatingPoint : Line3Type, LineFloatingPoint where Self.SubLine2 : Line2FloatingPoint
-
A line that is described by two 3-dimensional vectors.
See moreDeclaration
Swift
public protocol Line3Type : LineType where Self.Vector : Vector3Type
-
A plane that represents a flat 2D surface in 3D space.
Declaration
Swift
public protocol Plane3Type : PlaneType where Self.Vector : Vector3Type
-
A 2D plane in 3D space that can be intersected with other intersectable planes, producing intersection lines.
A plane-intersectable plane is implicitly a line-intersectable plane as well.
See moreDeclaration
Swift
public protocol PlaneIntersectablePlane3Type : LineIntersectablePlaneType where Self.Vector : Vector3Type
-
Protocol for 3D vector types with additive scalars.
See moreDeclaration
Swift
public protocol Vector3Additive : Vector3Type, VectorAdditive where Self.SubVector2 : Vector2Additive, Self.SubVector4 : Vector4Additive
-
Protocol for 3D vector types where the components are floating-point numbers
See moreDeclaration
Swift
public protocol Vector3FloatingPoint : Vector3Multiplicative, VectorFloatingPoint where Self.SubVector2 : Vector2FloatingPoint, Self.SubVector4 : Vector4FloatingPoint
-
Protocol for 3D vector types with multiplicable scalars.
See moreDeclaration
Swift
public protocol Vector3Multiplicative : Vector3Additive, VectorMultiplicative where Self.SubVector2 : Vector2Multiplicative
-
Protocol for 3D vector types where the components are Real numbers
See moreDeclaration
Swift
public protocol Vector3Real : Vector3FloatingPoint, VectorReal where Self.SubVector2 : Vector2Real
-
Protocol for types that can represent 3D vectors.
See moreDeclaration
Swift
public protocol Vector3Type : VectorTakeable where Self == Self.SubVector3, Self.TakeDimensions == Vector3TakeDimensions
-
Protocol for 4D vector types with additive scalars.
See moreDeclaration
Swift
public protocol Vector4Additive : Vector4Type, VectorAdditive where Self.SubVector3 : Vector3Additive
-
Protocol for 4D vector types where the components are floating-point numbers
See moreDeclaration
Swift
public protocol Vector4FloatingPoint : Vector4Additive, VectorFloatingPoint where Self.SubVector3 : Vector3FloatingPoint
-
Protocol for types that can represent 4D vectors.
See moreDeclaration
Swift
public protocol Vector4Type : VectorTakeable where Self.TakeDimensions == Vector4TakeDimensions
-
A protocol for projective spaces, where lower-dimensional spaces can be represented as embedded in higher dimensional features, like a point on a 2D plane in 3D.
See moreDeclaration
Swift
public protocol ProjectiveSpace
-
Protocol for general geometric types that can be fitted into a finite, non-empty axis-aligned bounding box.
See moreDeclaration
Swift
public protocol BoundableType
-
Protocol for N-dimensional geometric types defined by floating-point vectors that form closed convex shapes which can be intersected by lines.
See moreDeclaration
Swift
public protocol ConvexType : GeometricType
-
A general geometric type.
Declaration
Swift
public protocol GeometricType
-
Protocol for general geometric types that can be intersected with lines.
See moreDeclaration
Swift
public protocol LineIntersectableType : GeometricType
-
Protocol for geometric types that support vector projection operations.
Types conforming to this protocol expose a function that can project an arbitrary vector onto their surface.
See moreDeclaration
Swift
public protocol PointProjectableType : GeometricType
-
Represents an object that exposes a single function that returns the signed distance to the closest point on the surface of a geometry.
See moreDeclaration
Swift
public protocol SignedDistanceMeasurableType : GeometricType
-
A type with values that support division.
See moreDeclaration
Swift
public protocol DivisibleArithmetic : Numeric
-
Protocol for objects that form geometric lines with two
See moreVectorAdditive
vectors representing two points on the line.Declaration
Swift
public protocol LineAdditive : LineType where Self.Vector : VectorAdditive
-
Protocol for objects that form geometric lines with two
See moreVectorDivisible
vectors representing two points on the line.Declaration
Swift
public protocol LineDivisible : LineMultiplicative where Self.Vector : VectorDivisible
-
Protocol for objects that form geometric lines with two floating-point vectors representing two points on the line.
See moreDeclaration
Swift
public protocol LineFloatingPoint : LineDivisible, PointProjectableType, SignedDistanceMeasurableType where Self.Vector : VectorFloatingPoint
-
Protocol for objects that form geometric lines with two
See moreVectorMultiplicative
vectors representing two points on the line.Declaration
Swift
public protocol LineMultiplicative : LineAdditive where Self.Vector : VectorMultiplicative
-
Protocol for objects that form geometric lines with two
VectorReal
vectors representing two points on the line.Declaration
Swift
public protocol LineReal : LineFloatingPoint where Self.Vector : VectorReal
-
Protocol for objects that form geometric lines with two
VectorSigned
vectors representing two points on the line.Declaration
Swift
public protocol LineSigned : LineMultiplicative where Self.Vector : VectorSigned
-
Protocol for objects that form geometric lines with at least two distinct points the line is guaranteed to cross.
See moreDeclaration
Swift
public protocol LineType : GeometricType
-
Represents a plane in N-dimensional space with a center point and a normal vector.
See moreDeclaration
Swift
public protocol PlaneType : GeometricType
-
Represents a plane type that has support for point-projection.
See moreDeclaration
Swift
public protocol PointProjectablePlaneType : PlaneType, PointProjectableType, SignedDistanceMeasurableType
-
Protocol refining
See moreRectangleType
withVectorAdditive
extensions.Declaration
Swift
public protocol AdditiveRectangleType : RectangleType where Self.Vector : VectorAdditive
-
Protocol for rectangle geometric types that can be combined as intersection and unions with other rectangles of the same type.
See moreDeclaration
Swift
public protocol SelfIntersectableRectangleType : RectangleType
-
Represents a
See moreVectorType
with addition and subtraction arithmetic operators available.Declaration
Swift
public protocol VectorAdditive : VectorType, AdditiveArithmetic where Self.Scalar : AdditiveArithmetic
-
Represents a
See moreVectorType
with comparison operators available.Declaration
Swift
public protocol VectorComparable : VectorType, Equatable where Self.Scalar : Comparable
-
Represents a
See moreVectorType
with support for division.Declaration
Swift
public protocol VectorDivisible : VectorMultiplicative where Self.Scalar : DivisibleArithmetic
-
Protocol for vector types where the components are floating-point numbers
See moreDeclaration
Swift
public protocol VectorFloatingPoint : VectorComparable, VectorDivisible, VectorSigned where Self.Scalar : FloatingPoint
-
Protocol for Vectors that support multiplication
See moreDeclaration
Swift
public protocol VectorMultiplicative : VectorAdditive where Self.Scalar : Numeric
-
Protocol for vector types where the components are real numbers.
See moreDeclaration
Swift
public protocol VectorReal : VectorFloatingPoint where Self.Scalar : Real
-
Vector type where the components are signed numbers.
See moreDeclaration
Swift
public protocol VectorSigned : VectorMultiplicative where Self.Scalar : Comparable, Self.Scalar : SignedNumeric
-
Protocol that vector types conform to to indicate that different combinations of their dimensions can be extracted into other known N-dimensional vector types.
See moreDeclaration
Swift
public protocol VectorTakeable : VectorType
-
Protocol for N-dimensional vector types.
See moreDeclaration
Swift
public protocol VectorType : GeometricType
-
Protocol for Matrix types.
See moreDeclaration
Swift
public protocol MatrixType : Equatable
-
Protocol for square matrices, or matrices with the same number of rows and columns.
See moreDeclaration
Swift
public protocol SquareMatrixType : TransposableMatrixType where Self == Self.Transpose
-
Protocol for matrices that support transposition.
See moreDeclaration
Swift
public protocol TransposableMatrixType : MatrixType