How can I get sin, cos, and tan to use degrees instead of radians?

后端 未结 5 2145
误落风尘
误落风尘 2020-11-29 00:13

When I\'m working with math in JS I would like its trig functions to use degree values instead of radian values. How would I do that?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 01:14

    Create your own conversion function that applies the needed math, and invoke those instead. http://en.wikipedia.org/wiki/Radian#Conversion_between_radians_and_degrees

提交回复
热议问题