Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-dev-f303 FastPWM3
FastMath/FastMath.cpp
- Committer:
- benkatz
- Date:
- 2016-02-05
- Revision:
- 0:4e1c4df6aabd
- Child:
- 20:bf9ea5125d52
File content as of revision 0:4e1c4df6aabd:
#include "FastMath.h" #include "LUT.h" const float Multiplier = 81.4873308631f; float FastMath::FastSin(float theta){ if (theta < 0.0f) theta += 6.28318530718f; if (theta >= 6.28318530718f) theta -= 6.28318530718f; return SinTable[(int) (Multiplier*theta)] ; } float FastMath::FastCos(float theta){ return FastSin(1.57079632679f - theta); }