 ### The sine, cosine and tangent functions

Background: In what follows we assume that you are familiar with trigonometry. The sine, cosine and tangent functions (denoted sin, cos and tan) 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 angle θ.

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, cosine and tangent functions (denoted sin, cos and tan) are defined as returning the following ratios: These ratios are functions of θ because x and y change with θ.

Graph of the sine 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 cosine 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 tangent 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 sine, cosine and tangent functions are said to be periodic. This means that they repeat themselves in the horizontal direction after a certain interval called a period. The sine and cosine functions have a period of 2π radians and the tangent function has a period of π radians.

Domain and range: From the graphs above we see that for both the sine and cosine functions the domain is all real numbers and the range is all reals from −1 to +1 inclusive. For the tangent function the domain is all real numbers except ±π/2, ±3π/2, ±5π/2, …, (or in degrees: ±90°, ±270°, ±450°, …), where the tangent function is undefined. The range of the tangent function is all real numbers.

The definitions of sine, cosine and tangent 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 sine and cosine functions is all complex numbers, and the domain of the tangent function is all complex numbers except ±π/2, ±3π/2, ±5π/2, …, where the tangent 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 sine, cosine and tangent functions. The following table gives these values as well as those for angles of 0° and 90° : Algorithms for calculating sine, cosine and tangent: Have you ever wondered how calculators and computers are able to calculate functions like sine, cosine and tangent? 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 within ±0.004.

If x is greater than π/4 these formulas are too inaccurate to be used directly. Instead cofunctions and symmetries of the sine, cosine and tangent 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 sine function, the cosine function and the tangent function.

How to use the sine, cosine and tangent 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 on you can, for example, type in cos(30d+2) to mean the cosine of 30 degrees plus 2 radians.)
• Set the p does / does not represent π option.
• Turn on complex numbers if you want to be able to evaluate the sine, cosine or tangent of a complex number.

• Click the Simplify button.

If you found this page in a web search you won’t see the
Table of Contents in the frame on the left.
Click here to display it.