1.2 degrees to radians 1.3 radian to degrees

Source: Internet
Author: User
Tags convert radians to degrees
Knowledge point:

1. The static field math. Pi contains the constant 'struct '.

2. radians are defined as 2 π R/r = 2 π, 360 ° angle = 2 π radians. Therefore, 1 radian is about 57.3 °, that is, 57 ° 17' 44. 806 '', 1 ° is π/180 radian, the approximate value is 0.01745 radian, the circumference is 2 π radians, the horizontal angle (I .e. 180 ° angle) is π radians, And the right angle is π/2 radian.

Problem:

All units use radians when using math class trigonometric functions. However, you have one or more degrees to measure. You want to convert these degrees into radians for use in math member functions.

Solution

To convert degrees to radians, multiply them by degrees/180:

1 using system; 2 using system. collections. generic; 3 using system. LINQ; 4 using system. text; 5 using system. threading. tasks; 6 7 namespace _ 04 degrees into radians 8 {9 class program10 {11 static void main (string [] ARGs) 12 {13 console. writeline ("input level:"); 14 var degrees = console. readline (); 15 double radians = convertdegreestoradians (convert. todouble (degrees); 16 console. writeline (radians); 17 console. readkey (); 18} 19 20 public static double convertdegreestoradians (double degrees) 21 {22 double radians = (math. (PI/180) * degrees; 23 return radians; 24} 25} 26}
View code

To convert radians to degrees, multiply by 180/degrees.

1 using system; 2 using system. collections. generic; 3 using system. LINQ; 4 using system. text; 5 using system. threading. tasks; 6 7 namespace _ 05 radian converted to Level 8 {9 class program10 {11 static void main (string [] ARGs) 12 {13 console. writeline ("input radians:"); 14 var radians = console. readline (); 15 double degrees = convertradianstodegrees (convert. todouble (radians); 16 console. writeline (degrees); 17 console. readkey (); 18} 19 20 public static double convertradianstodegrees (double radians) 21 {22 double degrees = (180/math. pi) * radians; 23 return degrees; 24} 25 26} 27}
View code

 

Verification Result

1. Enter 180 and the result is success.

2. Enter limit and the result is 180.

1.2 degrees to radians 1.3 radian to degrees

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.