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()
  • Declaration

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Default Implementation

    Declaration

    Swift

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

    Default Implementation

    Declaration

    Swift

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

    Swift

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

    Swift

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