www.pudn.com > tranarctodeg.zip > tranarctodeg.txt, change:2017-05-14,size:1556b


 public static string transArctoDegree(double Arc) 
        { 
            int d, m, s; double t; string degree; 
            if (Arc >= 0) 
            { 
                t = 180.0 * Arc / Math.PI; 
                d = (int)(t); 
                //d = Convert.ToInt32(t); 
                m = Convert.ToInt32((t - d) * 60); 
                if (m >= 60) 
                { 
                    d += 1; m -= 60; 
                } 
                if (d == 0) 
                    degree = m + ""; 
                else 
                { 
                    if (m == 0) 
                        degree = d + ""; 
                    //s = (int)((t - d - m / 60.0) * 3600); 
                    else 
                        degree = d + "" + m + ""; 
                } 
                //+s + ""; 
                return degree; 
            } 
            else 
            { 
                t = Math.Abs(180.0 * Arc / Math.PI); 
                d = (int)(t); 
                m = Math.Abs(Convert.ToInt32((t - d) * 60)); 
                if (m >= 60) 
                { 
                    d += 1; m -= 60; 
                } 
                if (d == 0) 
                    degree = "-" + m + ""; 
                else 
                { 
                    if (m == 0) 
                        degree = "-" + d + ""; 
                    else 
                        degree = "-" + d.ToString() + "" + m.ToString() + ""; 
                } 
                //+s + ""; 
                return degree; 
            } 
        }