Closed kyren closed 4 years ago
Looks good to me, thanks!
@bors-servo r+
:pushpin: Commit b60359a has been approved by nical
:hourglass: Testing commit b60359a3162e54a567dbe665ec0cc8b07aa7a118 with merge b37c5048a7a6b15cf1a4d40923a820a3ec328b3e...
:sunny: Test successful - checks-travis Approved by: nical Pushing b37c5048a7a6b15cf1a4d40923a820a3ec328b3e to master...
These methods check that the length of the vector is not zero and return None in that case. It is slightly cleaner than either checking that the vector is not equal to zero or checking that the length is not zero before calling the regular
normalize
method.If the vector has very small component values, length may be calculated as zero, and thus the length of the normalized vector will be infinity.
Another possibility here is to copy
nalgebra
and have amin_length
parameter, rather than assuming that minimum length is always zero.