Skip to content
ihateDesmos

Graphs of trig functions

8 min read · Updated 6 November 2026

Sine and cosine make smooth waves, while tangent repeats in steep branches split by asymptotes. Four numbers, in y = a sin(b(x − c)) + d, control the height, width and position of any trig graph.

Sin, cos and tan compared

FunctionPeriodRangeStarts atAsymptotes
sin x2π−1 to 10, risingNone
cos x2π−1 to 11, its peakNone
tan xπAll real numbers0, risingx = π/2 + nπ
sec x2π|y| ≥ 11x = π/2 + nπ
csc x2π|y| ≥ 1Undefinedx = nπ
cot xπAll real numbersUndefinedx = nπ

Cosine is sine shifted left by π/2, so the two curves have exactly the same shape.

−6−4−2246−220
Open in calculator
y=sin(x)
in blue,
y=cos(x)
in red and
y=tan(x)
in green. Sine and cosine stay between −1 and 1, and tangent has no such limit.

The general form

y=asin(b(x−c))+d
LetterNameWhat it does
aAmplitude|a| is the height from the centre line to a peak. Negative a flips the wave.
bFrequencyThe period is 2π/|b|. A larger b squeezes the wave.
cPhase shiftMoves the wave right by c.
dVertical shiftMoves the centre line to y = d.

Everything here is also true for cosine. For tangent, the period is π/|b|.

−6−4−2246−220
Open in calculator
The original (blue), a doubled amplitude (red), a halved period (green) and a shift right by 1 and up by 2 (purple).

A worked example

Find the features of y = 3 sin(2x − π) + 1.

  1. Factor out b, so it matches the general form: 3 sin(2(x − π/2)) + 1.
  2. Amplitude: 3, so the wave goes 3 above and below its centre.
  3. Period: 2π/2 = π.
  4. Phase shift: π/2 to the right.
  5. Centre line: y = 1. The maximum is 4, and the minimum is −2.

The most common mistake is reading the phase shift as π directly. Always factor out b first.

How to sketch a trig graph

  1. Draw the centre line y = d, and the lines for the maximum and minimum.
  2. Work out the period, and divide it into four equal parts along the x-axis, starting from the phase shift.
  3. For sine, plot in order: centre, maximum, centre, minimum, centre. For cosine: maximum, centre, minimum, centre, maximum.
  4. Join the points with a smooth wave, and repeat in each direction.

Where the waves come from

On the unit circle, the height of a point moving at a steady speed traces out a sine wave, and its horizontal position traces out a cosine wave. That is why trig functions model anything that repeats, like sound, light, tides and alternating current. Fourier’s remarkable discovery was that any repeating signal can be built by adding sine waves together.

Frequently asked questions

What is the period of sin x?
2π, or 360°. The wave repeats every 2π along the x-axis. The period of tan x is π.
How do you find the amplitude?
It is |a| in y = a sin(bx). From a graph, it is half the distance from the maximum to the minimum.
What is the difference between the sin and cos graphs?
They have the same shape, but cosine is shifted left by π/2. Sine starts at 0, and cosine starts at its peak.
Does tan x have an amplitude?
No. Tangent has no maximum or minimum, because it goes to infinity near its asymptotes.
What is a phase shift?
A horizontal shift of the wave. In y = sin(x − c), the graph moves right by c.

Keep going

Try it in the calculator

Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.

Open the calculator