Position3d
Three-component value. Arithmetic returns new values; up is +Y and forward is +Z.
Module: atlas/units
Three-component value. Arithmetic returns new values; up is +Y and forward is +Z.
Declaration
export class Position3d { ... }Constructors
Creates a new position 3D.
constructor(x: number, y: number, z: number);Properties
x
The X.
x: number;y
The Y.
y: number;z
The Z.
z: number;Methods
zero
Zero.
static zero(): Position3d;down
Down.
static down(): Position3d;up
Up.
static up(): Position3d;forward
Forward.
static forward(): Position3d;back
Back.
static back(): Position3d;right
Right.
static right(): Position3d;left
Left.
static left(): Position3d;invalid
Returns a value whose coordinate components are NaN.
static invalid(): Position3d;add
Returns a new value by adding the operand component-wise; a numeric operand applies to every component.
add(other: Position3d | number): Position3d;subtract
Returns a new value by subtracting the operand component-wise; a numeric operand applies to every component.
subtract(other: Position3d | number): Position3d;multiply
Returns a new value by multiplying by the operand component-wise; a numeric operand applies to every component.
multiply(other: Position3d | number): Position3d;divide
Returns a new value by dividing by the operand component-wise; a numeric operand applies to every component.
divide(other: Position3d | number): Position3d;is
Tests exact equality of all components.
is(other: Position3d): boolean;normalized
Returns a unit-length copy, or a zero vector if the length is zero.
normalized(): Position3d;toString
Returns a human-readable representation.
toString(): string;