Class Vector

A class that implements the Ttuple base type and represents a Vector a a 3-Dimensional Coordinate system

Hierarchy

  • Vector

Implements

Constructors

Properties

w x y z

Methods

Constructors

Properties

w: 0
x: number
y: number
z: number

Methods

  • This method gives the current state of the vector instance

    Remarks

    This method returns 4 numbers, the first 3 representing the current values of the x,y,z directions and a 4th number 'w' representing the fact that it is a Vector and not a Point

    Returns

    An array containing of numbers representing the current state of the Vector instance

    Returns number[]

  • Performs a cross multiplication of two tuples, mostly vectors

    Returns

    A new vector that is the cross product of the other two vectors

    Parameters

    • other: Ttuple

      The second tuple to cross multiply with

    Returns Vector

  • Performs a dot product operation on two tuples.

    Returns

    A number that is the result of the dot product of the two tuples

    Parameters

    • other: Ttuple

      The second tuple to peform a dot product with

    Returns number

  • Checks if the current vector instance is identical to some other given vector instance and that the other vector is an instance of Vector

    Parameters

    • other: Ttuple

      Another tuple (Vector) to check for equality

    • EPS: number = 0.000001

    Returns boolean

  • Negates the values of the components of the Vector, except for component w

    Returns void

Generated using TypeDoc