How to convert Degrees to Radians and Back in C#

This is quite simple, but may be useful for somebody…

 public double DegToRad(double angle)
 {
     return angle * (Math.PI / 180);
 }

 public double RadToDeg(double angle)
 {
     return angle / (Math.PI / 180);
 }

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s