Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.52 KB

README.md

File metadata and controls

29 lines (22 loc) · 1.52 KB

SpeedTrig

@mathvav stability level: stable @mathvav maintenance level: not maintained (pull requests still accepted)

⚠️ Note: This repository is no longer actively maintained, though it is unlikely to be broken. Consider https://github.com/RobTillaart/FastTrig, which has a bit more community support and is better maintained.

Simple Arduino library that speeds up trigonometry functions, based on work by Oscar Liang.

Simply drag the main folder into the libraries subdirectory of your Arduino IDE sketch folder.

This is a simple output (via serial) to show accuracy of library compared to the Arduino functions:

Sin 15: 
 - Standard [RAD]: 0.6503
 - Fast [DEG]: 0.2588
Cos 15: 
 - Standard [RAD]: -0.7597
 - Fast [DEG]: 0.9659
Acos .15: 
 - Standard [RAD]: 1.4202
 - Fast [RAD]: 1.4230
Atan2 5, 5: 
 - Standard [RAD]: 0.7854
 - Fast [RAD]: 0.7823

As it stands, sine and cosine both return degrees from this library—however, it's simple to convert between radians and degrees. I'd happily welcome a pull request to unify all four functions to use the same units, along with helper functions to convert from degrees to radians and vice versa.