KieranWynn / pyquaternion

A fully featured, pythonic library for representing and using quaternions
http://kieranwynn.github.io/pyquaternion/
MIT License
339 stars 68 forks source link

Reduce numerical error #79

Open shmpwk opened 2 years ago

shmpwk commented 2 years ago

When we set radians large value, it often causes numerical error. This is because calling _wrap_angle is late. So I try to reduce numerical error by calling _wrap_angle earlier.

e.x. Quaternion(axis=[0.0,0.0,1.0], radians=4.0*np.pi).radians The current version output is 4.440892098500626e-16 On the other hand, this PR outputs 0.0