Vec3:equals

Returns whether a vector is approximately equal to another vector.


equal = Vec3:equals(u)

Arguments

NameTypeDescription
uVec3 The other vector.

Returns

NameTypeDescription
equalboolean Whether the 2 vectors approximately equal each other.

equal = Vec3:equals(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
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