Vector3
Overview
Description
Vector3
represents a vector used in 3D space that includes x, y, and z coordinates. It is commonly used in 3D rendering, physics calculations, and position computations.
Properties
X
number
Represents the X-axis coordinate value.
Code Samples
Y
number
Represents the Y-axis coordinate value.
Code Samples
Z
number
Represents the Z-axis coordinate value.
Code Samples
zero
Vector3
A vector where all axis values are 0. (0, 0, 0)
Code Samples
one
Vector3
A vector where all axis values equal 1. (1, 1, 1)
Code Samples
xAxis
Vector3
The unit vector defined in the direction of the X-axis.
Code Samples
yAxis
Vector3
The unit vector defined in the direction of the Y-axis.
Code Samples
zAxis
Vector3
The unit vector defined in the direction of the Z-axis.
Code Samples
Unit
Normalizes the vector to produce a unit vector.
Code Samples
Magnitude
The magnitude (length) of the vector
Code Samples
Constructors
new
Creates a Vector3
instance with specified x, y, and z coordinates.
Parameters
number x
The x-coordinate value
number y
The y-coordinate value
number z
The z-coordinate value
Return
Vector3
A new instance of Vector3
Code Samples
Methods
Dot
It returns the scalar inner product of the two vectors.
Parameters
Vector3
vector
Parameter for dot product.
Return
number
Result of dot product calculation.
Code Samples
Cross
It returns the vector cross product of the two vectors.
Parameters
Vector3
Parameter for cross product.
Return
Vector3
Result of cross product calculation.
Code Samples
Last updated