crertel / graphmath

An Elixir library for performing 2D and 3D mathematics.
The Unlicense
81 stars 13 forks source link

Normalize should not crash on zero quaternion #19

Closed crertel closed 5 years ago

crertel commented 5 years ago

Quaternions of norm 0 cause the current normalize implementation to blow up, which is no good.

We should fix it to return a 0 quaternion in such cases, and maybe add a normalizeStrict that explodes otherwise.