Interface Vec<N>

A N-d vector.

interface Vec<N> {
    length: N;
    add(rhs): this;
    dot(rhs): number;
    lerp(rhs, t): this;
    mul(m): this;
    normalize(): boolean;
    scale(factor): this;
    sub(rhs): this;
}

Type Parameters

  • N extends 2 | 3 | 4

Implemented by

Properties

Methods

Properties

length: N

Returns the length of Vec.

Methods

  • Adds RHS to this vector.

    Parameters

    Returns this

  • Computes the dot product of this vector with RHS.

    Parameters

    Returns number

  • Computes the linear interpolation between this vector and RHS.

    Parameters

    • rhs: Vec<N>
    • t: number

    Returns this

  • Premultiplies matrix to this vector.

    Parameters

    Returns this

  • Normalizes this vector.

    Returns boolean

  • Scales this vector by given factor.

    Parameters

    • factor: number

    Returns this

  • Subtracts RHS from this vector.

    Parameters

    Returns this

Generated using TypeDoc