This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

20
proto/source/TRIG.CPP Normal file
View File

@@ -0,0 +1,20 @@
#include <proto/trig.hpp>
#include <proto/angles.hpp>
#include <proto/fixed.hpp>
#include <common/math.hpp>
void TrigTable::build(const Angles &angles)
{
double angleRad;
angle360(angles.angle360());
mCosTable.size(angles.angle360());
mSinTable.size(angles.angle360());
for(int currAngle=0;currAngle<angles.angle360();currAngle++)
{
angleRad=Math::pi2()*(double)currAngle/(double)angles.angle360();
mCosTable.operator[](currAngle)=(int)(Math::cos(angleRad)*FixedPoint::FPMul);
mSinTable.operator[](currAngle)=(int)(Math::sin(angleRad)*FixedPoint::FPMul);
}
}