Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

math - Does the .net framework have a build-in method to convert from degrees to radians?

I know that I can just say:

radians  = degrees * Math.PI/180

However I expect there to be a built in framework method, as it is such a common requirement, however I cannot find one. Am I not looking hard enough or is it missing from the .net framework.

(Please don’t insult me by telling me how to write my own method.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I believe there is no such method.

The angle, a, must be in radians. Multiply by Math.PI/180 to convert degrees to radians.

Above quote taken from Math.Sin remarks section.

If there is one method in .Net framework, documentation would suggest us to use that rather than giving the formula to implement.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...