Functions

The following functions are available globally.

  • Returns the pointwise minimal Vector where each component is the minimal scalar value at each index for both vectors.

    Convenience for pointwiseMin(_:_:).

    Declaration

    Swift

    public func min<V>(_ lhs: V, _ rhs: V) -> V where V : VectorComparable
  • Returns the pointwise maximal Vector where each component is the maximal scalar value at each index for both vectors.

    Convenience for pointwiseMax(_:_:).

    Declaration

    Swift

    public func max<V>(_ lhs: V, _ rhs: V) -> V where V : VectorComparable
  • Rounds the components of a given VectorFloatingPoint using FloatingPointRoundingRule.toNearestOrAwayFromZero.

    Equivalent to calling C’s round() function on each component.

    Declaration

    Swift

    public func round<V>(_ x: V) -> V where V : VectorFloatingPoint
  • Rounds up the components of a given VectorFloatingPoint using FloatingPointRoundingRule.up.

    Equivalent to calling C’s ceil() function on each component.

    Declaration

    Swift

    public func ceil<V>(_ x: V) -> V where V : VectorFloatingPoint
  • Rounds down the components of a given VectorFloatingPoint using FloatingPointRoundingRule.down.

    Equivalent to calling C’s floor() function on each component.

    Declaration

    Swift

    public func floor<V>(_ x: V) -> V where V : VectorFloatingPoint
  • Returns a VectorSigned with each component as the absolute value of the components of a given VectorSigned.

    Equivalent to calling C’s abs() function on each component.

    Convenience for absolute.

    print(abs(Vector2D(x: 2.0, y: -1.0))) // Prints "(x: 2.0, y: 1.0)"
    

    Declaration

    Swift

    public func abs<V>(_ x: V) -> V where V : VectorSigned
  • Performs an equality check over a tuple of Matrix2x2 values.

    Declaration

    Swift

    public func == <T>(lhs: Matrix2x2<T>.M, rhs: Matrix2x2<T>.M) -> Bool where T : DivisibleArithmetic, T : Real
  • Performs an equality check over a tuple of Matrix3x3 values.

    Declaration

    Swift

    public func == <T>(lhs: Matrix3x3<T>.M, rhs: Matrix3x3<T>.M) -> Bool where T : DivisibleArithmetic, T : Real
  • Performs an equality check over a tuple of Matrix4x4 values.

    Declaration

    Swift

    public func == <T>(lhs: Matrix4x4<T>.M, rhs: Matrix4x4<T>.M) -> Bool where T : DivisibleArithmetic, T : Real