The sin, cos and tan functions
Background: In what follows we assume that you are familiar with
The sin, cos and tan functions are important in trigonometry and many other areas of mathematics.
Here is how they are derived. Consider the vector (the red arrow) in the picture to the right.
It has its tail at the origin, has length r and is oriented at
Let (x, y) denote the coordinates of the
head of the vector (i.e. let x and y be the
movements in the x and then in the y direction
required to get from the tail to the head of the vector.)
The three arrows form a triangle in standard position.
Now imagine changing the angle θ. The vector will point in another
direction but its head will still be somewhere on the dotted circle
(because its length r is unchanged).
The values of x and y will change. For example in the picture
to the right the values of x and y are both negative.
Definitions: The sine (or sin), cosine (or cos) and tangent (or tan)
functions are defined as returning the following ratios:
These ratios are functions of θ because x and y change with
Graph of the sin function: The picture on the left shows the red vector
pointing at various angles θ
and the graph on the right shows the resulting function sin (θ):
Graph of the cos function: The next picture on the left again shows
the red vector pointing at various angles θ
and the graph on the right shows the resulting function cos (θ):
Graph of the tan function: The next graph shows the function tan (θ). The dotted vertical
lines are asymptotes (lines that the function approaches but never touches):
In the above three graphs the angle θ is measured in radians.
If you want θ to be measured in degrees then
simply change the horiontal scale so
that θ runs from 0 to 360° instead of from 0 to 2π radians;
the shapes of the graphs are otherwise unchanged.
The sin, cos and tan functions are said to be periodic. This means
that they repeat themselves in the horizontal direction after
a certain interval called a period. The sin and cos functions have a period of
2π radians and the tan function has a period of π radians.
Domain and range: From the graphs above we see that
for both the sin and cos functions the domain is all
real numbers and the range is all reals from −1 to +1 inclusive.
For the tan function the domain is all real numbers except
±π/2, ±3π/2, ±5π/2, …,
(or in degrees:
±90°, ±270°, ±450°, …),
where the tan function is undefined.
The range of the tan function is all real numbers.
The definitions of sin, cos and tan can be
extended to the complex numbers
by defining the functions by their Taylor series
instead of by the ratio of two lengths.
In that case, the domain and range of the sin and cos functions is all
complex numbers, and the domain of the tan function is all complex numbers
except ±π/2, ±3π/2, ±5π/2, …,
where the tan function is undefined,
and the range is all complex numbers.
Special values: For the two triangles shown below, Pythagoras' theorem gives simple,
exact values for the lengths of the sides and hence for the values of the
sin, cos and tan functions. The following table gives these values as well as
those for angles of 0° and 90° :
Algorithms for calculating sin, cos and tan: Have you ever wondered how calculators and
computers are able to calculate functions like sin, cos and tan?
The answer is that they make use of formulas like these:
These formulas are called polynomial approximations and are based on Taylor's series.
To use them x must be in radians. They are very accurate when x
is close to 0 but lose accuracy as x gets bigger. When
x = π/4 radians (i.e. 45°) the sin formula is only accurate
to within ±0.00004, cos to within ±0.000004 and tan to
If x is greater than π/4 these formulas are too inaccurate to be used directly.
Instead cofunctions and symmetries of the sin, cos and tan functions are
exploited to reduce the angle x and improve the accuracy.
For example, to calculate
sin(440°), use is made of the fact that this is the same as sin(80°),
which is the same as cos(10°) which is the same as cos(0.174533 radians),
which is then computed using the cos formula.
Click here to see algorithms that computers use for calculating the
the cos function and
the tan function.
How to use the sin, cos and tan functions in the Algebra Coach
- Type sin(x), cos(x) or tan(x) into the textbox, where x is the argument.
The argument must be enclosed in brackets.
- Set the relevant options:
- Set the exact / floating point option. (Exact mode lets you
use special values.)
- Set the degree / radian mode option.
(Radian mode is more versatile and recommended. Then any angles that
you enter are assumed to be in radians, but you can still
enter angles in degrees by following them with the letter d;
see the next bullet.)
- Set the d does / does not represent the ° symbol option.
(This option is only available in radian mode. When this option is set you can,
for example, type in cos(30d+2) to mean the cosine of 30 degrees plus 2
- Set the p does / does not represent π option.
- Turn on complex numbers if you want to be able to evaluate
the sin, cos or tan of a complex number.
- Click the Simplify button.