input pi for `pi` and sqrt(2) for square root of 2 for example.
Trigonometric functions (also called circular functions or angle functions) can be defined with different approaches explained below :
- definitions using a right triangle
- definitions using the trigonometric circle
- definitions implying complex numbers
Right triangle and trigonometric functions
Opposite side of angle Â: a
Adjacent side of angle Â: b
Hypotenuse of the angle Â: c
sin Â = opposite side/hypotenuse = a/c
cos Â = adjacent side/hypotenuse = b/c
tan Â = opposite side/adjacent side = a/b
cot A = adjacent/opposite = b/a
sec A = hypotenuse/adjacent = c/b
sec Â = 1/cos Â
csc A = hypotenuse/opposite = c/a
csc Â = 1/sin Â
We assume that an orthogonal coordinate system is defined by Ox and Oy axes.
The trigonometric circle is centered on point O and has radius 1. It is oriented counterclockwise i.e. from Ox to Oy.
Let M be a point of the circle and `alpha` a radians measurement of the angle (Ox, OM) then,
- the cosine of alpha, noted cos(`alpha`) is the horizontal coordinate of M.
- the sinus of alpha, noted sin (`alpha`) is the vertical coordinate of M.
Trigonometric functions applied to complex numbers
Commonly used trigonometric functions can be extended to complex numbers as following,
We suppose that a and b are real numbers.
`sin(a + b*i) = sin(a)*cosh(b) + i cos(a)*sinh(b)`
`cos(a + b*i) = cos(a)*cosh(b) - i sin(a)*sinh(b)`
`tan(a + b*i) = (sin(2*a)+ i*sinh(2*b))/(cos(2*a)+cosh(2*b))`