VectorAdditive

public protocol VectorAdditive : VectorType, AdditiveArithmetic where Self.Scalar : AdditiveArithmetic

Represents a VectorType with addition and subtraction arithmetic operators available.

  • nonZeroScalarCount Default implementation

    Gets the number of scalars within this vector that has a non-zero value.

    Default Implementation

    Declaration

    Swift

    var nonZeroScalarCount: Int { get }
  • init() Default implementation

    Initializes a zero-valued VectorType

    print(Vector2D()) // Prints "(x: 0.0, y: 0.0)"
    print(Vector2i()) // Prints "(x: 0, y: 0)"
    

    Default Implementation

    Declaration

    Swift

    init()
  • Undocumented

    Declaration

    Swift

    static func + (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func - (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func + (lhs: Self, rhs: Scalar) -> Self
  • Undocumented

    Declaration

    Swift

    static func - (lhs: Self, rhs: Scalar) -> Self
  • +=(_:_:) Default implementation

    Undocumented

    Default Implementation

    Declaration

    Swift

    static func += (lhs: inout Self, rhs: Self)
  • -=(_:_:) Default implementation

    Undocumented

    Default Implementation

    Declaration

    Swift

    static func -= (lhs: inout Self, rhs: Self)
  • Undocumented

    Declaration

    Swift

    static func += (lhs: inout Self, rhs: Scalar)
  • Undocumented

    Declaration

    Swift

    static func -= (lhs: inout Self, rhs: Scalar)