Vec3:angle

Returns the angle between vectors.


angle = Vec3:angle(u)

Arguments

NameTypeDescription
uVec3 The other vector.

Returns

NameTypeDescription
anglenumber The angle to the other vector, in radians.

angle = Vec3:angle(x, y, z)

Arguments

NameTypeDescription
xnumber The x component of the other vector.
ynumber The y component of the other vector.
znumber The z component of the other vector.

Returns

NameTypeDescription
anglenumber The angle to the other vector, in radians.

Notes

If any of the two vectors have a length of zero, the angle between them is not well defined. In this case the function returns math.pi / 2.

See also