Hi,
How do you calculate trig functions like cos, sin, tan in the iPhone SDK?
i tried tan(45) but it returns wrong output? any help?
Hi,
How do you calculate trig functions like cos, sin, tan in the iPhone SDK?
i tried tan(45) but it returns wrong output? any help?
functions like cos, sin and tan are in the standard library and can be used by including math.h. You can get a good overview of these by typing 'man math
' in a Terminal window on your Mac. More specific info can be read by typing 'man sin
' for example. You will then see that sin() takes a radians arguments, not degrees. Search here on Stack Overflow if you don't know how to convert radians to degrees.