首页 > 其他 > 详细

C#三角函数使用

时间:2015-09-02 11:59:45      阅读:134      评论:0      收藏:0      [点我收藏+]

 public static double tricorn(double n, string str)
        {
            double pi = System.Math.PI;
            switch (str)
            {
                case "sin": return System.Math.Sin(n * pi / 180);
                case "cos": return System.Math.Cos(n * pi / 180);
                case "tan": return System.Math.Tan(n * pi / 180);
                case "cot": return 1.0 / System.Math.Tan(n * pi / 180);
                case "asin": return System.Math.Asin(n)*180/pi;
                case "acos": return System.Math.Acos(n))*180/pi;
                case "atan": return System.Math.Atan(n))*180/pi;
                case "acot": return System.Math.Atan(1.0 / n))*180/pi;
                default:
                    return 0;
            }
        }

C#三角函数使用

原文:http://my.oschina.net/ucliaohh/blog/500582

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!