Creates a new ObservableVector3d instance.
The x-coordinate of the vector. Default is 0.
The y-coordinate of the vector. Default is 0.
The z-coordinate of the vector. Default is 0.
Optionalcallback: () => voidThe callback function to be called when the point changes. Default is undefined.
Gets the x-coordinate of the point.
Sets the x-coordinate of the point.
The new x-coordinate value.
Gets the y-coordinate of the point.
Sets the y-coordinate of the point.
The new y-coordinate value.
Update this vector values to absolute values
Reference to this object for method chaining
Add the passed vector to this vector
other vector
Reference to this object for method chaining
return the angle between this vector and the passed one
other vector
angle in radians
Clamp the vector value within the specified value range
lower bound
upper bound
new Vector3d
Clamp this vector value within the specified value range
lower bound
upper bound
Reference to this object for method chaining
return a clone copy of this vector
Optionalcb: () => voidcallback function to override the clone values
new Vector3d
Copy the components of the given vector into this one
other vector
Reference to this object for method chaining
calculate the cross product of this vector and the passed one
other vector
Reference to this object for method chaining
return the distance between this vector and the passed one
other vector
distance
Divide this vector values by the passed value
the value to divide the vector by
Reference to this object for method chaining
return the dot product of this vector and the passed one
other vector
The dot product.
return true if this vector is equal to the given values or vector
other vector or vector components
true if both vectors are equal
return the length (magnitude) of this vector
the length of this vector
return the square length of this vector
The length^2 of this vector.
Linearly interpolate between this vector and the given one.
other vector
distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
Reference to this object for method chaining
Update this vector with the maximum value between this and the passed vector
other vector
Reference to this object for method chaining
Update this vector with the minimum value between this and the passed vector
other vector
Reference to this object for method chaining
interpolate the position of this vector on the x and y axis towards the given one by the given maximum step.
other vector
the maximum step per iteration (Negative values will push the vector away from the target)
Reference to this object for method chaining
normalize this vector (scale the vector so that its magnitude is 1)
Reference to this object for method chaining
change this vector to be perpendicular to what it was before.
(Effectively rotates it 90 degrees in a clockwise direction around the z axis)
Reference to this object for method chaining
project this vector on to another vector.
The vector to project onto.
Reference to this object for method chaining
Project this vector onto a vector of unit length.
This is slightly more efficient than project when dealing with unit vectors.
The unit vector to project onto.
Reference to this object for method chaining
Revokes the proxy object, preventing further access to the ObservablePoint instance.
Rotate this vector (counter-clockwise) by the specified angle (in radians) around the z axis
Reference to this object for method chaining
Multiply this vector values by the given scalar
x component
Optionaly: number = xy component
Optionalz: number = 1z component
Reference to this object for method chaining
Multiply this vector values by the passed vector
other vector
Reference to this object for method chaining
Sets the x and y coordinates of the point.
The new x-coordinate value.
The new y-coordinate value.
The new z-coordinate value.
Reference to this object for method chaining.
Sets the callback function to be called when the point changes.
The callback function.
Sets the x and y coordinates of the point without triggering the callback.
The new x-coordinate value.
The new y-coordinate value.
Reference to this object for method chaining.
set the Vector x and y properties using the passed vector
other vector
Reference to this object for method chaining
set the Vector x and y properties to 0
Reference to this object for method chaining
Substract the passed vector to this vector
other vector
Reference to this object for method chaining
Convert this vector into 2d coordinate space
Reference to this object for method chaining
Convert this vector into isometric coordinate space
Reference to this object for method chaining
convert the object to a string representation
stringified representation
Represents a point in a 3D coordinate vector that can be observed for changes.