VectorType

public protocol VectorType : AdditiveArithmetic

An value that can be used with ×(:) and ÷(::) in conjunction with a scalar.

Conformance Requirements:

  • AdditiveArithmetic
  • static func ×= (lhs: inout Self, rhs: Scalar)
  • static func ÷= (lhs: inout Self, rhs: Scalar)
  • ×(_:_:) Default implementation

    Returns the product of the left times the right.

    Mutating variant

    ×=

    Default Implementation

    Returns the product of the left times the right.

    Mutating variant

    ×=

    Returns the product of the left times the right.

    Declaration

    Swift

    static func × (lhs: Self, rhs: Scalar) -> Self

    Parameters

    lhs

    A value.

    rhs

    A scalar coefficient.

  • Returns the product of the left times the right.

    Declaration

    Swift

    static func × (lhs: Scalar, rhs: Self) -> Self

    Parameters

    lhs

    A scalar coefficient.

    rhs

    A value.

  • Modifies the left by multiplication with the right.

    Nonmutating variant

    ×

    Declaration

    Swift

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

    Parameters

    lhs

    The value to modify.

    rhs

    The scalar coefficient by which to multiply.

  • Returns the quotient of the left divided by the right.

    Mutating variant

    ×

    Declaration

    Swift

    static func ÷ (lhs: Self, rhs: Scalar) -> Self

    Parameters

    lhs

    The dividend.

    rhs

    The divisor.

  • Modifies the left by dividing it by the right.

    Nonmutating variant

    ÷

    Declaration

    Swift

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

    Parameters

    lhs

    The value to modify.

    rhs

    The divisor.