Shop OBEX P1 Docs P2 Docs Learn Events
SPIN_TrigPack object update — Parallax Forums

SPIN_TrigPack object update

cessnapilotcessnapilot Posts: 182
edited 2010-06-18 17:55 in Propeller 1
Hi All,

Timmoore found a bug in SPIN_TrigPack v1.4, such as when the call is

· Deg_ATAN2(-1, -256)

there is an overflow and the return is a very large number rather than close to -90. He proposed a correction that not only removed the bug, but doubled the accuracy of ATAN2 and improved the accuracy of ASIN and ACOS noticeably. See, for example

··········· More accurate new results··········· ··· Less accurate prev. results
ATAN2(0.7071, 0.7071)=44.998·········· ATAN2(0.7071, 0.7071)=44.9949
··················ASIN(0.5)=29.9909··················· ······· ASIN(0.5)=29.9877
·················ACOS(0.5)=60.0091·························· ACOS(0.5)=60.0122
···········
The new version (v1.5) of SPIN_TrigPack has been placed at OBEX.

http://obex.parallax.com/objects/501/

This works now with better than 0.01 degrees of accuracy for the inverse trig functions.

Thank you Tim.

Cheers,

Istvan


(SPIN_TrigPack is faster than Floatmath and has a True Random Number Generator that is written in SPIN only.)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Intentionally Left Blank
Sign In or Register to comment.