Vec4:angle

Returns the angle between vectors.


angle = Vec4:angle(u)

Arguments

NameTypeDescription
uVec4 The other vector.

Returns

NameTypeDescription
anglenumber The angle to other vector, in radians.

angle = Vec4:angle(x, y, z, w)

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.
wnumber The w component of the other vector.

Returns

NameTypeDescription
anglenumber The angle to 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