Question: Please create a function called d_to_r that takes a double as a parameter representing the degrees and returns the angle in radians. To get full
Please create a function called d_to_r that takes a double as a parameter representing the degrees and returns the angle in radians. To get full credit you will need to make sure that your answer is within the +- 360-degrees (or +- 2PI)
Using C++
For basic conversion from degrees to radians use:
angle_in_radians = angle_in_degrees * PI/180.0;
Note: For PI add the following above int main(){
const double PI = atan(1.0)*4.0; // PI is a global constant
Example 1:
720-degrees should be converted to 0 degrees before converting it to radians
Example 2:
450-degrees should be converted to 90 degrees before converting it to radians
Example 3:
750-degrees should be converted to 30 before converting it to radians.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
