| Vector.add(v: Vector, a: number | Vector): Vector |
Returns the addition of a number or Vector to a copy of the given vector. |
| Vector.addX(v: Vector, a: number): Vector |
Returns the addition of a number to the X component of a copy of the given vector. |
| Vector.addY(v: Vector, a: number): Vector |
Returns the addition of a number to the Y component of a copy of the given vector. |
| Vector.addZ(v: Vector, a: number): Vector |
Returns the addition of a number to the Z component of a copy of the given vector. |
| Vector.angleBetween(v0: Vector, v1: Vector): number |
Returns the angle in radians between the two given vectors. Range: [0, PI]. |
| Vector.axis(a: number): Vector |
Returns the corresponding unit vector that represents the given axis constant. Any of the following are acceptable values for the axis number: (Vector.X_AXIS, Vector.Y_AXIS, Vector.Z_AXIS). |
| Vector.closest(v: Vector, V: Array<Vector>): Vector |
Returns the vector in the given array of vectors that has the smallest distance from the given vector. |
| Vector.copy(v: Vector | {x: number, y: number, z: number}): Vector |
Returns a copy of the given vector or creates a vector from an object with x, y, z properties. |
| Vector.cross(v0: Vector, v1: Vector): Vector |
Returns the cross product of a copy of the first given vector by the second given vector. |
| Vector.div(v: Vector, a: number | Vector): Vector |
Returns the division of a number or Vector from a copy of the given vector. |
| Vector.divX(v: Vector, a: number): Vector |
Returns the division of a number from the X component of a copy of the given vector. |
| Vector.divY(v: Vector, a: number): Vector |
Returns the division of a number from the Y component of a copy of the given vector. |
| Vector.divZ(v: Vector, a: number): Vector |
Returns the division of a number from the Z component of a copy of the given vector. |
| Vector.dot(v0: Vector, v1: Vector): number |
Returns the dot product of the two given vectors. |
| Vector.equals(v0: Vector, v1: Vector): boolean |
Returns true if the two vectors have the same X, Y, Z components. |
| Vector.furthest(v: Vector, V: Array<Vector>): Vector |
Returns the vector in the given array of vectors that has the largest distance from the given vector. |
| Vector.mag(v: Vector): number |
Returns the magnitude of the given vector. |
| Vector.mult(v: Vector, a: number | Vector): Vector |
Returns the multiplication of a number or Vector by a copy of the given vector. |
| Vector.multX(v: Vector, a: number): Vector |
Returns the multiplication of a number by the X component of a copy of the given vector. |
| Vector.multY(v: Vector, a: number): Vector |
Returns the multiplication of a number by the Y component of a copy of the given vector. |
| Vector.multZ(v: Vector, a: number): Vector |
Returns the multiplication of a number by the Z component of a copy of the given vector. |
| Vector.neg(v: Vector): Vector |
Returns the negation of a copy of the given vector. |
| Vector.normalize(v: Vector): Vector |
Returns a normalized copy of the given vector. |
| Vector.qRotate(v: Vector, q: Quaternion): Vector |
Shorthand for Vector.quaternionRotate() |
| Vector.quaternionRotate(v: Vector, q: Quaternion): Vector |
Returns a copy of the given vector rotated by the given quaternion. See also: Quaternion
|
| Vector.rotateAxis(v: Vector, axis: number | Vector, angle: number): Vector |
Returns a copy of the given vector rotated by the given angle around the given axis. One of the following number constants can also be given as the axis: (Vector.X_AXIS, Vector.Y_AXIS, Vector.Z_AXIS). |
| Vector.rotateX(v: Vector, xAngle: number): Vector |
Returns a copy of the given vector rotated around the X-axis by the given angle. |
| Vector.rotateY(v: Vector, xAngle: number): Vector |
Returns a copy of the given vector rotated around the Y-axis by the given angle. |
| Vector.rotateZ(v: Vector, xAngle: number): Vector |
Returns a copy of the given vector rotated around the Z-axis by the given angle. |
| Vector.sub(v: Vector, a: number | Vector): Vector |
Returns the subtraction of a number or Vector from a copy of the given vector. |
| Vector.subX(v: Vector, a: number): Vector |
Returns the subtraction of a number from the X component of a copy of the given vector. |
| Vector.subY(v: Vector, a: number): Vector |
Returns the subtraction of a number from the Y component of a copy of the given vector. |
| Vector.subZ(v: Vector, a: number): Vector |
Returns the subtraction of a number from the Z component of a copy of the given vector. |
| Vector.transform(v: Vector, M: Array<Array<number>>): Vector |
Returns the transformation of a copy of the given vector by the given 3 or 4 dimensional Matrix. |
| Vector.xAxis(): Vector |
Returns the unit vector that lies upon the X-axis. |
| Vector.yAxis(): Vector |
Returns the unit vector that lies upon the Y-axis. |
| Vector.zAxis(): Vector |
Returns the unit vector that lies upon the Z-axis. |