Skip to content

Commit

Permalink
- optimize fcos and fsin to use the BAM value directly for table lookup.
Browse files Browse the repository at this point in the history
No need to convert back and forth to rad.
  • Loading branch information
coelckers committed Mar 20, 2022
1 parent 735740e commit 3b52031
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/core/binaryangle.h
Expand Up @@ -144,8 +144,8 @@ class binangle
constexpr double signedrad() const { return tosigned() * (pi::pi() / 0x80000000u); }
constexpr double signeddeg() const { return AngleToFloat(tosigned()); }

double fsin() const { return g_sin(asrad()); }
double fcos() const { return g_cos(asrad()); }
double fsin() const { return g_sinbam(asbam()); }
double fcos() const { return g_cosbam(asbam()); }
double ftan() const { return g_tan(asrad()); }
int bsin(const int8_t& shift = 0) const { return ::bsin(asbuild(), shift); }
int bcos(const int8_t& shift = 0) const { return ::bcos(asbuild(), shift); }
Expand Down

0 comments on commit 3b52031

Please sign in to comment.