remove decimal cast from Fix64.Atan2

pull/21/head
cosmonaut 2022-08-05 16:56:26 -07:00
parent 72ad850ab4
commit 28e3479444
1 changed files with 3 additions and 3 deletions

View File

@ -488,14 +488,14 @@ namespace MoonWorks.Math.Fixed
var z = y / x;
// Deal with overflow
if (One + (Fix64)0.28M * z * z == MaxValue)
if (One + Fix64.FromFraction(28, 100) * z * z == MaxValue)
{
return y < Zero ? -PiOver2 : PiOver2;
}
if (Abs(z) < One)
{
atan = z / (One + (Fix64)0.28M * z * z);
atan = z / (One + Fix64.FromFraction(28, 100) * z * z);
if (xl < 0)
{
if (yl < 0)
@ -507,7 +507,7 @@ namespace MoonWorks.Math.Fixed
}
else
{
atan = PiOver2 - z / (z * z + (Fix64)0.28M);
atan = PiOver2 - z / (z * z + Fix64.FromFraction(28, 100));
if (yl < 0)
{
return atan - Pi;