Changelog
[main]
Adding
GeometriaAlgorithmslibrary that will feature useful computational geometry algorithm implementations.Adding
TransposableMatrixTypeprotocol to describe matrices that can be transposed into another known matrix type.Fixing
NSphere.project(_:Vector)being offset from correct point by-self.center.TakeVector3has been removed in favor ofVectorTakeableprotocol.Forcing
Vector3-specializing protocols to require the same specialization on itsSubVector4, e.g.Vector3FloatingPointnow requiresSubVector4: Vector4FloatingPoint.Added
Vector3Multiplicative.tripleProductmethod.Forcing
Vector2-specializing protocols to require the same specialization on itsSubVector3, e.g.Vector2FloatingPointnow requiresSubVector3: Vector3FloatingPoint.Added
Vector2Multiplicative.tripleProductmethod.Added
NSquare.verticeswhenNSquare.Vectorconforms toVectorAdditive.Added
LineCategorybit-flag forLineTypeconformers that specifies the category of the line type (line, ray, or line segment).Added
PlaneIntersectablePlane2Typeto generalize line intersection of 1D planes (lines) in 2D spaces.Added
PlaneIntersectablePlane3Typeto generalize line intersection of 2D planes in 3D spaces.
v0.0.2
Added
Hyperplaneprotocol to represent hyperplanes, along with proper type aliases for 2-, 3-, and 4-dimensional hyperplanes.Added
VectorTakeableprotocol, and making all vector protocols conform to it. With it, it’s possible to index into a vector type to produce different vector types based on combinations of dimensions of a vector:
let vector = Vector3D(x: 3.5, y: 2.1, z: 1.0)
print(vector[.x, .z]) // Prints "(x: 3.5, y: 1.0)"
print(vector[.x, .z, .y]) // Prints "(x: 3.5, y: 1.0, z: 2.1)"
print(vector[.z, .y, .x]) // Prints "(x: 1.0, y: 2.1, x: 3.5)"
print(vector[.z, .y, .x, .z]) // Prints "(x: 1.0, y: 2.1, x: 3.5, w: 1.0)"
Added
Vector<2/3/4>TakeDimensionsto accompany theVectorTakeableprotocol and serve as a default conformance to4>Typeprotocols.Added
AdditiveRectangle.verticesgetter, which is automatically synthesized for any conforming type.
v0.0.1
Initial release