You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Segment has an isZeroLength method - would it make sense to add the same for Vector?
Of couse I can do vec.length === 0, but this involves an expensive Math.sqrt.
I can do vec.dot(vec) === 0 to avoid the sqrt, but this somewhat less readable.
The text was updated successfully, but these errors were encountered:
Alternatively, maybe we could have a lengthSquared method - that would also serve cases where vectors need to be compared by length, and the overhead of the sqrt is not necessary
Segment has an
isZeroLength
method - would it make sense to add the same forVector
?Of couse I can do
vec.length === 0
, but this involves an expensiveMath.sqrt
.I can do
vec.dot(vec) === 0
to avoid the sqrt, but this somewhat less readable.The text was updated successfully, but these errors were encountered: