Hello, this is my 2nd time posting here. My prof said that in order to use trigonometric function, I need to convert the angle from degrees to radian. My idea is to define the angle in degrees in term of z. ie: z = angle * ( PI / 180)
But then I don't know how to proceed giving the value of angle. How can I assign the values for my angles?
If my code is already wrong from the start please tell me.
My code need to give the following output:
Enter an angle between -360 and 360 degrees: -180
Enter an angle between -360 and 360 degrees: 180
Angle (degrees) cos sin cosh sinh
-180.0 -1.00 -0.00 11.59 -11.55
180.0 -1.00 0.00 11.59 11.55
This code is as far as I can go right now.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <iostream> //Preprocessor Directive
#include <iomanip>
#include<math.h>
const double PI = acos(-1.0); // value of pi
int main()
{
double z1, z2, angle1, angle2, v, w, x, y;
z1 = angle1 * ( PI / 180.0 );
z2 = angle2 * ( PI / 180.0 );
v = cos ( z1 ) , cos ( z2 );
w = sin ( z1 ) , sin ( z2 );
x = cosh ( z1 ) , cosh ( z2 );
y = sinh ( z1 ) , cosh ( z2 );
cout << z1
cout << "Enter an angle between -360 and 360 degrees: ";
cin >> angle1;
cout << "Enter an angle between -360 and 360 degrees: ";
cin >> angle2;
return 0;
}
|