Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...