customizing code for Aliexpress 14 bit version with MA702

Dependencies:   mbed FastPWM3

FastMath/FastMath.cpp

Committer:
ahmed_lv
Date:
2020-11-10
Revision:
52:af0f52e2ecda
Parent:
20:bf9ea5125d52

File content as of revision 52:af0f52e2ecda:

#include "FastMath.h"
#include "LUT.h"

const float Multiplier = 81.4873308631f;

float FastMath::FastSin(float theta){
    while (theta < 0.0f) theta += 6.28318530718f;
    while (theta >= 6.28318530718f) theta -= 6.28318530718f;    
    return SinTable[(int) (Multiplier*theta)] ;
    }
    
float FastMath::FastCos(float theta){
    return FastSin(1.57079632679f - theta);
    }