Link to home
Start Free TrialLog in
Avatar of techpage
techpage

asked on

sine and cosine problem

i don't know radian, so how do i use sin() and cos() with degrees??

can you help me with some code to display this:

sin(45) = 0.50000
cos(45) = 0.50000
sin(0)  = 0.00000
cos(0)  = 1.00000
sin(90) = 1.00000
cos(90) = 0.00000
Avatar of akshayxx
akshayxx
Flag of United States of America image

the sine and cosine functions from math.h take arguments in radians , so do this

sin(theta*PI/180)

theta ur angle in degrees and PI is a constant = value of PI( 3.1415.....) this is also available in math.h as M_PI

hope this works
Avatar of techpage
techpage

ASKER

ummm... but how is:

sin(theta) = 3/5

how do I find theta?
ASKER CERTIFIED SOLUTION
Avatar of idyott
idyott

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Theta is your angle...

sin of 45 degrees is...

sin(45/180 * PI)