vec3:div

Divides the vector by a vector or a number.

v = vec3:div(u)

Arguments

NameTypeDescription
uvec3The other vector to divide the components by.

Returns

NameTypeDescription
vvec3The original vector.

v = vec3:div(x)

Arguments

NameTypeDescription
xnumberThe number to divide each component by.

Returns

NameTypeDescription
vvec3The original vector.

Notes

This function modifies v and sets the values to equal the divided values. When dividing by a vector, the division is component-wise, like this:

v.x, v.y, v.z = v.x / u.x, v.y / u.y, v.z / u.z

Dividing by a number divides each component of the vector by that number:

v.x, v.y, v.z = v.x / x, v.y / x, v.z / x

See also