角度轉成弧度

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
 
            const double PI = 3.14159265358979323846264338;
            Console.WriteLine("請輸入度(60.5656表明60度56分56秒");          ouble a = Convert.ToDouble(Console.ReadLine());
            double b = Math.Floor(a);
            double c = Math.Floor((a - b) * 100) / 60;
            double d = Math.Floor((a - b) * 10000 - c * 60 * 100) / 3600; double e = PI * (b + c + d) / 180;
            Console.WriteLine("弧度爲:{0}", e);
            Console.ReadLine();
        }
    }
}
相關文章
相關標籤/搜索