Vec4:equals

Returns whether a vector is approximately equal to another vector.


equal = Vec4:equals(u)

Arguments

NameTypeDescription
uVec4 The other vector.

Returns

NameTypeDescription
equalboolean Whether the 2 vectors approximately equal each other.

equal = Vec4:equals(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
equalboolean Whether the 2 vectors approximately equal each other.

Notes

To handle floating point precision issues, this function returns true as long as the squared distance between the vectors is below 1e-10.

See also