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.
Fork of priustroller_2 by
fastmath.cpp
00001 #include "includes.h" 00002 #include "fastmath.h" 00003 #include "lut.h" 00004 00005 float FastMath::FastSin(float theta) { 00006 if (theta < 0.0f) theta += 360.0f; 00007 if (theta >= 360.0f) theta -= 360.0f; 00008 return 2.0f * sinetab[(int) theta] - 1.0f; 00009 } 00010 00011 float FastMath::FastCos(float theta) { 00012 return FastSin(90.0f - theta); 00013 } 00014 00015 float FastMath::FastSin01(float theta) { 00016 return FastSin(theta) * 0.5f + 0.5f; 00017 } 00018 00019 float FastMath::FastCos01(float theta) { 00020 return FastCos(theta) * 0.5f + 0.5f; 00021 }
Generated on Tue Jul 12 2022 18:31:15 by
1.7.2
