From 3b5203132f92664e610c0d94e2a83254290c337c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 22 Feb 2022 17:49:19 +0100 Subject: [PATCH] - optimize fcos and fsin to use the BAM value directly for table lookup. No need to convert back and forth to rad. --- source/core/binaryangle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/binaryangle.h b/source/core/binaryangle.h index 8caf61f69f6..93524c48d75 100644 --- a/source/core/binaryangle.h +++ b/source/core/binaryangle.h @@ -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); }