yoanlcq / vek

Generic 2D-3D math swiss army knife for game engines, with SIMD support and focus on convenience.
https://docs.rs/vek
Apache License 2.0
282 stars 32 forks source link

Reconsider epsilon used for `is_approx_zero` #97

Open Imberflur opened 2 weeks ago

Imberflur commented 2 weeks ago

In #48 I made is_approx_zero use the same is_magnitude_close_to method that is used to check if something is normalized.

The primary use I know of for is_approx_zero is checking if a vector can be normalized which is possible for values much closer to zero than what is_magnitude_close_to checks for (in is_normalized we needed a larger range to cover all normalized vectors).

So I'm wondering if this should be reconsidered? I don't have any pressing use case for this. Just realized this when looking back over #48 and wanted to document it in an issue.