private static double GetATan2(double atanX, double atanY, out double xyhyp2)
{
double atan4;
xyhyp2 = Math.Sqrt((atanX*atanX*TenThousand) + (atanY*atanY*TenThousand));
var angleRad4 = GetArcCos((atanX*OneMillion)/xyhyp2);
if (atanY < 0)
atan4 = -angleRad4;
else
atan4 = angleRad4;
return atan4;
}