Creates a new 3-element vector with the given values.
The unit vector î which points in the x direction: vec3 1 0 0
The unit vector ĵ which points in the y direction: vec3 0 1 0
The unit vector k̂ which points in the z direction: vec3 0 0 1
The set functions create a new copy of the vector, updating a single field.
Extract the x component of a vector.
Extract the y component of a vector.
Extract the z component of a vector.
Update the x component of a vector, returning a new vector.
Update the y component of a vector, returning a new vector.
Update the z component of a vector, returning a new vector.
Vector addition: a + b
Vector subtraction: a - b
Vector negation: -a
Multiply the vector by a scalar: s * v
The dot product of a and b
The cross product of a and b
A unit vector with the same direction as the given vector: a / |a|
The normalized direction from b to a: (a - b) / |a - b|
The length of the given vector: |a|
The square of the length of the given vector: |a| * |a|
The distance between two vectors.
The square of the distance between two vectors.
Convert a vector to a record.
Convert a record to a vector.
Three dimensional vector type