HexapiBackground.IK.InverseKinematics.GetArcCos C# (CSharp) Méthode

GetArcCos() private static méthode

private static GetArcCos ( double cos ) : double
cos double
Résultat double
        private static double GetArcCos(double cos)
        {
            var c = cos/TenThousand;

            if ((Math.Abs(Math.Abs(c) - 1.0) < 1e-60)) //Why does this make a difference if there is only 15/16 decimal places in regards to precision....?
            {
                return (1 - c)*Pi/2.0;
            }

            return (Math.Atan(-c/Math.Sqrt(1 - c*c)) + 2*Math.Atan(1))*TenThousand;

            //return (Math.Abs(Math.Abs(c) - 1.0) < 1e-60
            //    ? (1 - c) * Pi / 2.0
            //    : Math.Atan(-c / Math.Sqrt(1 - c * c)) + 2 * Math.Atan(1)) * TenThousand;
        }