munum - v0.3.0
    Preparing search index...

    Interface Vec<N>

    A N-d vector.

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

    Type Parameters

    • N extends 2 | 3 | 4

    Implemented by

    Index
    length: N

    Returns the length of Vec.

    • 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