Skip to main content

Radians and sine waves

Measure an angle by the length of arc it cuts from the unit circle and a full turn becomes 2π. Unroll the circle and the sine becomes a wave that repeats every 2π; then stretch it, slow it and slide it with an amplitude, a period and a phase.
M01.5.3L0 Foundation25 minIn review

Before this lesson

M01.5.2 The unit circle and polar coordinates

After this lesson you can

  • Define the radian as arc length on the unit circle, and convert between degrees and radians with the factor π/180.
  • Explain how plotting the height of a turning point against the distance it has travelled draws the sine wave, and why the wave repeats every 2π.
  • Show that the cosine wave is the sine wave moved a quarter turn earlier.
  • Read the amplitude, period, frequency and phase of y = A sin(2πt/T + φ) off a graph, and predict what changing each one alone does.

In review. The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.

The question

Ask Python for math.sin(90) and it answers about \(0.894\). But the point at \(90^\circ\) on the unit circle is \({(0, 1)}\), so the sine of a right angle is 1. Python is not wrong: it measures angles in a different unit, the one that the formulas of machine learning use, from the seasonal patterns of a sales forecast to the position codes of a language model. What is that unit, and why does it turn a circle into a wave?

From the last lesson

1. What are the coordinates of the point at angle \(\theta\) on the unit circle?

Show answer

\({(\cos\theta, \sin\theta)}\): the cosine is how far across, the sine how far up.

2. What does math.atan2(4, -3) return, in degrees, and why not \({-53.13^\circ}\)?

Show answer

About \(126.87^\circ\), once converted with math.degrees. It sees that \(x\) is negative and \(y\) positive, so it answers in the second quarter; \({-53.13^\circ}\) would point at \({(3, -4)}\).

Intuition

So far an angle has been measured in degrees, a full turn cut into 360 equal parts, a number chosen long ago. There is a way to measure an angle that needs no chosen number at all: walk round the unit circle and measure how far you have walked.

Left: a unit circle with a thick blue arc of length 1 starting at the positive x-axis, two radii of length 1 at its ends, and a small blue angle mark labelled 1 rad; underneath, angle: 1 radian, about 57.30 degrees. Right: a circle of radius 1 resting on a line at 0, and a dashed copy of it after one full roll, resting at 2 pi; the first unit of the line is thick and blue and labelled 1; the line is marked pi over 2, pi, 3 pi over 2 and 2 pi, with 90, 180, 270 and 360 degrees underneath; a dashed bracket above reads one full turn rolls out 2 pi, about 6.28.
M01.5.3-F1

Left: the angle that cuts an arc of length 1 from the unit circle is one radian, about \(57.30^\circ\). Right: roll the unit circle once along a line and it covers its whole circumference, \(2\pi\), about \(6.28\).

The angle whose arc is exactly as long as the radius is called one radian. A full turn walks the whole circumference. Every circle’s circumference is \(\pi\) times its diameter, where \(\pi\) is about \(3.14159\), and the unit circle has diameter 2, so a full turn is \(2\pi\) radians, about \(6.28\). A half turn is \(\pi\) and a quarter turn is \({\pi/2}\).

Then a picture follows almost by itself. Walk round the circle at a steady pace and, at every moment, plot how high you are against how far you have walked. The height rises, falls, dips below zero and comes back: the circle unrolls into a wave.

Build it up

Step 1. Converting. A full turn is both \(360^\circ\) and \(2\pi\) radians, so one degree is \({2\pi/360}\) of a radian, which simplifies to \({\pi/180}\). To turn degrees into radians, multiply by \({\pi/180}\); to go back, multiply by \({180/\pi}\). One radian is \({180/\pi}\) degrees, about \(57.30^\circ\).

Degrees Radians As a decimal
\(30^\circ\) \({\pi/6}\) \(0.5236\)
\(45^\circ\) \({\pi/4}\) \(0.7854\)
\(60^\circ\) \({\pi/3}\) \(1.0472\)
\(90^\circ\) \({\pi/2}\) \(1.5708\)
\(180^\circ\) \(\pi\) \(3.1416\)
\(360^\circ\) \(2\pi\) \(6.2832\)

From here on, an angle with no degree sign is in radians. That is the habit of mathematics and machine-learning texts, and the reason math.sin expects radians.

Step 2. Arcs on bigger circles. On a circle of radius \(r\) every length is \(r\) times the length on the unit circle (scaled copies again), so an angle of \(\theta\) radians cuts an arc of length \(r\theta\).

Step 3. Unroll the circle. Plot \(\sin\theta\), the height of the point, against \(\theta\), the distance walked. Because the angle is measured in radians, one unit along the graph is one unit walked round the circle.

Left: a unit circle with twelve blue dots, one every 30 degrees starting from the point (1, 0). Right: the vermillion sine wave from 0 to 2 pi, with a vermillion dot at every multiple of pi over 6. Dotted horizontal lines carry the height of each blue dot across to its vermillion dot on the wave. The wave rises to 1 at pi over 2, falls through 0 at pi, reaches minus 1 at 3 pi over 2 and returns to 0 at 2 pi.
M01.5.3-F2

Every \(30^\circ\), which is \({\pi/6}\), the height of the point is carried across to the graph. The sine wave is the circle unrolled.

Step 4. The wave repeats. After a walk of \(2\pi\) the point is back where it started, so the heights start again: \({\sin(\theta + 2\pi) = \sin\theta}\) for every \(\theta\). A function that repeats like this is called periodic, and \(2\pi\) is the period of the sine.

Step 5. The cosine is the same wave, a quarter turn earlier. Take the right triangle under the point at angle \(\theta\), with \(\cos\theta\) across and \(\sin\theta\) up. Turn the whole triangle a further quarter turn about the origin. Its across side now points straight up, and its up side now points left. So the point at \({\theta + \pi/2}\) is \({(-\sin\theta, \cos\theta)}\), and its height is the old width:

\[ \sin\!\left(\theta + \frac{\pi}{2}\right) = \cos\theta . \]

The signs of the sides travel with them, so this holds in every quarter. Check at \(30^\circ\): the point at \(120^\circ\) has height \(\sin 120^\circ\), about \(0.8660\), which is \(\cos 30^\circ\).

Left: the upper half of a unit circle with the triangle at 30 degrees, a sky-blue across side labelled cosine theta and a vermillion up side, and the same triangle turned a quarter turn by a green curved arrow: its sky-blue side, still labelled cosine theta, now stands upright along the vertical axis, and its vermillion side, labelled sine theta, points left. A note reads new height equals old width. Right: the vermillion sine wave and the sky-blue cosine wave on one axis from 0 to 2 pi, with a green arrow showing that the cosine's peak at 0 comes pi over 2 earlier than the sine's peak at pi over 2. Above: cosine theta equals sine of theta plus pi over 2.
M01.5.3-F3

A quarter turn makes the old width the new height, so the cosine wave is the sine wave moved \({\pi/2}\) earlier.

The formal statement

NoteDefinitions: radian and wave

The radian measure of an angle is the length of the arc it cuts from the unit circle. A full turn is \(2\pi\) radians, and \(\theta\) degrees is \({\theta \times \pi/180}\) radians.

A sine wave in time \(t\) is

\[ y = \cparam{A}\sin\!\left(\frac{2\pi t}{\cparam{T}} + \cparam{\phi}\right), \]

with amplitude \({\cparam{A} > 0}\), period \({\cparam{T} > 0}\) and phase \(\cparam{\phi}\) (a Greek phi, in radians). Its frequency is \({1/\cparam{T}}\), the number of repeats per unit of time.

The formula has a picture behind it. A point goes round a circle of radius \(A\) at a steady pace, once every \(T\) units of time, starting at the angle \(\phi\). By time \(t\) it has made \({t/T}\) of a turn, which is \({2\pi t/T}\) radians, so its angle is \({2\pi t/T + \phi}\) and its height is \(y\). Each of the three numbers changes one thing.

Three graphs stacked, each with the dashed plain wave sine of 2 pi t over 4 from t equals 0 to 8 and a solid vermillion wave. Top, titled Amplitude: A equals 1 to A equals 2: the solid wave 2 sine of 2 pi t over 4 has the same crossings but peaks twice as high, marked by an orange bracket A equals 2. Middle, titled Period: T equals 4 to T equals 8: the solid wave sine of 2 pi t over 8 makes one cycle while the dashed wave makes two, with an orange bracket T equals 8 under the whole axis. Bottom, titled Phase: phi equals 0 to phi equals pi over 2: the solid wave sine of 2 pi t over 4 plus pi over 2 is the dashed wave moved left, and a green arrow notes 1 earlier: a quarter of the period.
M01.5.3-F4

Each parameter changed alone, against the dashed wave with \({A = 1}\), \({T = 4}\) and \({\phi = 0}\).

The amplitude sets the height. The sine is always between \({-1}\) and \(1\), so \(y\) is always between \({-A}\) and \(A\). The peaks are \(A\) above the middle line and the troughs \(A\) below it.

The period sets the repeat. Move \(t\) on by \(T\) and look at the angle inside the sine. Multiplying out the bracket,

\[ \frac{2\pi (t + T)}{T} + \phi = \frac{2\pi t}{T} + 2\pi + \phi . \]

That is the angle at time \(t\) plus exactly \(2\pi\), one full turn, and by Step 4 a full turn changes no sine. So \(y\) at time \({t + T}\) equals \(y\) at time \(t\): the wave repeats every \(T\), and a larger \(T\) means a slower wave.

The phase slides the wave. Write the shift as a time \(d\), with \({\phi = 2\pi d / T}\). Then the angle inside the sine is

\[ \begin{aligned} \frac{2\pi t}{T} + \phi &= \frac{2\pi t}{T} + \frac{2\pi d}{T} \\ &= \frac{2\pi (t + d)}{T} , \end{aligned} \]

the angle that the plain wave, with no phase, reaches at time \({t + d}\). So at time \(t\) the wave already has the value that the plain wave reaches at time \({t + d}\): a positive phase moves the whole wave earlier, to the left on a graph, by

\[ d = \frac{\phi\, T}{2\pi} . \]

Go deeper: why formulas use radians, not degrees

Radians are not just another choice like degrees. Because a radian is a length on the circle, a small angle and the height it produces are almost the same number: a short arc is nearly a straight line standing up from the axis, and the arc’s length is the angle. For an angle of \(0.01\) radians the sine is about \(0.0099998\). In degrees the same angle is \(0.573^\circ\), and nothing that simple holds. This is why calculus (M04) finds the slope of \(\sin\theta\) at \(0\) to be exactly 1 when \(\theta\) is in radians, and why libraries measure angles in them.

Worked example

Read the amplitude, period, frequency and phase off the graph below, and write the wave.

A graph from t equals 0 to 8 with a solid vermillion wave that starts at its peak 2, crosses 0 at t equals 1, reaches minus 2 at t equals 2, crosses 0 at t equals 3 and peaks again at t equals 4, with dots at those five points. An orange bracket over the top from t equals 0 to 4 reads T equals 4: peak to peak, and an orange bracket at t equals 8 reads A equals 2. A dashed grey wave with no phase starts at 0 and peaks at t equals 1, and a green arrow from t equals 1 back to t equals 0 reads 1 earlier. The formula y equals 2 sine of 2 pi t over 4 plus pi over 2 is written top right.
M01.5.3-F5

A wave read off its graph: \({A = 2}\), \({T = 4}\) and a peak that comes 1 unit early.

Amplitude. The wave runs from \({-2}\) up to \(2\), so its peaks are 2 above the middle line: \({A = 2}\).

Period and frequency. Peaks come at \({t = 0}\), \({t = 4}\) and \({t = 8}\), so the wave repeats every 4: \({T = 4}\). The frequency is \({1/4}\), which is \(0.25\) repeats per unit of time.

Phase. The plain wave \({2\sin(2\pi t/4)}\), dashed, starts at 0 and has its first peak a quarter of a period in, at \({t = 1}\). This wave peaks at \({t = 0}\), which is 1 earlier. So \({d = 1}\), and

\[ \phi = \frac{2\pi d}{T} = \frac{2\pi \times 1}{4} = \frac{\pi}{2} . \]

The wave is \({y = 2\sin(2\pi t/4 + \pi/2)}\). Check it at the five dots:

\(t\) angle in radians \(y\)
\(0\) \({\pi/2}\) \(2\)
\(1\) \(\pi\) \(0\)
\(2\) \({3\pi/2}\) \({-2}\)
\(3\) \(2\pi\) \(0\)
\(4\) \({5\pi/2}\) \(2\)

At \({t = 4}\) the angle is \({5\pi/2}\), which is \({2\pi + \pi/2}\): one full turn past \({\pi/2}\), so the values start again. By Step 5, this wave is also \({2\cos(2\pi t / 4)}\).

Code

A converter from scratch, then the hook’s puzzle solved:

import math

def to_radians(degrees):
    return degrees * math.pi / 180

def to_degrees(radians):
    return radians * 180 / math.pi

for d in [30, 45, 60, 90, 180, 360]:
    print(d, "degrees =", round(to_radians(d), 4), "radians")
print("one radian =", round(to_degrees(1), 2), "degrees")

print("math.sin(90):", round(math.sin(90), 4), "  math.sin(pi/2):", math.sin(to_radians(90)))
print("90 radians =", round(to_degrees(90), 2), "degrees")
30 degrees = 0.5236 radians
45 degrees = 0.7854 radians
60 degrees = 1.0472 radians
90 degrees = 1.5708 radians
180 degrees = 3.1416 radians
360 degrees = 6.2832 radians
one radian = 57.3 degrees
math.sin(90): 0.894   math.sin(pi/2): 1.0
90 radians = 5156.62 degrees

Ninety radians is \(5156.62^\circ\), which is 14 full turns (\(5040^\circ\)) and \(116.62^\circ\) more, and the sine of \(116.62^\circ\) is about \(0.8940\). Python answered exactly the question it was asked.

Next the wave of the worked example, sampled in a loop, with a check that it repeats after one period:

A, T, phi = 2, 4, math.pi / 2

def wave(t):
    return A * math.sin(2 * math.pi * t / T + phi)

for t in range(9):
    print("t =", t, " y =", round(wave(t), 4) + 0.0)     # adding 0.0 turns -0.0 into 0.0

repeats = True
for k in range(100):
    t = k * 0.13                                         # many times, not only whole numbers
    if not math.isclose(wave(t + T), wave(t), abs_tol=1e-12):
        repeats = False
print("repeats after one period:", repeats)
t = 0  y = 2.0
t = 1  y = 0.0
t = 2  y = -2.0
t = 3  y = 0.0
t = 4  y = 2.0
t = 5  y = 0.0
t = 6  y = -2.0
t = 7  y = 0.0
t = 8  y = 2.0
repeats after one period: True

Finally NumPy, which applies np.sin to a whole array of angles at once. np.linspace(0, 2 * np.pi, 9) makes nine evenly spaced angles from \(0\) to \(2\pi\), every \(45^\circ\):

import numpy as np

theta = np.linspace(0, 2 * np.pi, 9)
print(np.round(np.sin(theta), 4) + 0.0)
print("repeats after 2 pi:", np.allclose(np.sin(theta + 2 * np.pi), np.sin(theta)))
print("cos is sin a quarter turn on:", np.allclose(np.cos(theta), np.sin(theta + np.pi / 2)))
[ 0.      0.7071  1.      0.7071  0.     -0.7071 -1.     -0.7071  0.    ]
repeats after 2 pi: True
cos is sin a quarter turn on: True

Waves like these are everywhere in machine learning. A forecast of monthly sales can describe the yearly pattern with terms such as \({\sin(2\pi t / 12)}\) and \({\cos(2\pi t / 12)}\) (time series, S07); sound is a sum of waves (A05); and the original transformer marks the position of each word with sines and cosines of many periods, so that a model can tell the first word from the fifth (DL05).

Explore

Go back to the unit-circle explorer in the previous lesson and press Play. The wave beside the circle (below it on a phone) is drawn against \(\theta\) in radians, marked at \(\pi\), \(2\pi\), \(3\pi\) and \(4\pi\). Watch the point pass \(360^\circ\), which is \(2\pi\): the wave starts again exactly as before. Press Trace cos θ too to see the second wave run a quarter turn ahead.

Pitfalls

Two unit circles. Left, marked with a cross and titled math.sin(90): a reddish-purple point at 116.62 degrees with its height 0.894 drawn as a reddish-purple vertical line, and the note 90 radians: 14 turns and 116.62 degrees more. Right, marked with a tick and titled math.sin(math.radians(90)): a vermillion point at the top of the circle with height 1, and the note 90 degrees equals pi over 2 radians, a quarter turn.
M01.5.3-F6

Wrong beside right. Without the conversion, Python turns 90 radians, more than 14 full turns.

“math.sin(90) is the sine of a right angle.”

Python’s math module and NumPy read every angle in radians. math.sin(90) turns 90 radians and returns about \(0.8940\). Convert first: math.sin(math.radians(90)) is \(1.0\), and so is math.sin(math.pi / 2). When a result looks strange, check the unit before anything else.

“A bigger number inside the sine means a longer period.”

It depends where the number sits. In \({\sin(2\pi t / T)}\) the period \(T\) divides, so a bigger \(T\) means a slower wave. But in \(\sin(2t)\) the 2 multiplies: the angle grows twice as fast, and the period is \(\pi\), half of \(2\pi\). Ask how long \(t\) takes to push the angle through \(2\pi\).

“A phase of \(\phi\) moves the wave by \(\phi\).”

The phase is an angle, and the shift is a time, \({\phi T / (2\pi)}\). They agree only when the period is \(2\pi\). In the worked example \(\phi\) is \({\pi/2}\), about \(1.57\), but the wave moves by 1, a quarter of its period of 4. A positive phase also moves the wave earlier, to the left.

Check yourself

Recall

1. What is one radian, and about how many degrees is it?

Show answer

The angle that cuts an arc of length 1 from the unit circle, an arc as long as the radius. It is \({180/\pi}\) degrees, about \(57.30^\circ\).

2. Convert \(45^\circ\) to radians and \({3\pi/2}\) radians to degrees.

Show answer

\(45^\circ\) is \({45 \times \pi/180}\), which is \({\pi/4}\), about \(0.7854\). And \({3\pi/2}\) is \({3\pi/2 \times 180/\pi}\), which is \(270^\circ\).

3. Why does \(\sin\theta\) repeat every \(2\pi\)?

Show answer

A walk of \(2\pi\) is one full turn of the unit circle, which brings the point back to where it started, so its height starts again.

4. In \({y = A\sin(2\pi t / T + \phi)}\), what do \(A\) and \(T\) measure on a graph?

Show answer

\(A\) is the height of a peak above the middle line; \(T\) is the time from one peak to the next.

5. How is the cosine wave related to the sine wave?

Show answer

It is the same wave moved a quarter turn, \({\pi/2}\), earlier: \({\cos\theta = \sin(\theta + \pi/2)}\).

Exercises

1. ★ Convert \(120^\circ\) and \(225^\circ\) to radians, exactly and to four decimal places, and convert \(2.5\) radians to degrees.

Show solution

\[ \begin{aligned} 120^\circ &= 120 \times \tfrac{\pi}{180} \\ &= \tfrac{2\pi}{3} \approx 2.0944, \\[0.3em] 225^\circ &= 225 \times \tfrac{\pi}{180} \\ &= \tfrac{5\pi}{4} \approx 3.9270, \\[0.3em] 2.5 &= 2.5 \times \tfrac{180^\circ}{\pi} \\ &\approx 143.24^\circ . \end{aligned} \]

2. ★★ Monthly sales swing 20 above and 20 below their average, the pattern repeats every 12 months, and it is at its highest at \({t = 0}\). Write the swing in the form \({A\sin(2\pi t / T + \phi)}\), give its frequency, and say when it is lowest.

Show solution

The swing is 20 either way, so \({A = 20}\), and it repeats every 12 months, so \({T = 12}\); the frequency is \({1/12}\) of a repeat per month, about \(0.0833\). A sine is highest when its angle is \({\pi/2}\), so at \({t = 0}\) the angle \(\phi\) must be \({\pi/2}\):

\[ y = 20\sin\!\left(\frac{2\pi t}{12} + \frac{\pi}{2}\right). \]

It is lowest when the angle is \({3\pi/2}\), half a turn later, which takes half a period: \({t = 6}\).

3. ★★★ Use a half turn to show that \({\sin(\theta + \pi) = -\sin\theta}\) for every \(\theta\). What does a phase of \({\phi = \pi}\) do to a wave?

Show solution

A half turn is two quarter turns. By Step 5 one quarter turn takes a point \({(x, y)}\) to \({(-y, x)}\), and a second one takes \({(-y, x)}\) to \({(-x, -y)}\). So the point at \({\theta + \pi}\) is \({(-\cos\theta, -\sin\theta)}\), and its height is \({\sin(\theta + \pi) = -\sin\theta}\). Therefore

\[ \begin{aligned} &A\sin\!\left(\frac{2\pi t}{T} + \pi\right) \\ &\quad = -A\sin\!\left(\frac{2\pi t}{T}\right): \end{aligned} \]

a phase of \(\pi\) turns the wave upside down, which is the same as moving it half a period.

Summary card

Measure angles by distance round the unit circle, and the sine becomes a wave.

The anchor figure again: an arc of length 1 on the unit circle marking one radian, about 57.30 degrees, and a unit circle rolled once along a line, covering 2 pi.
M01.5.3-F1

One radian is an arc of length 1.

  • A full turn is \(2\pi\) radians; degrees times \({\pi/180}\) gives radians, and one radian is about \(57.30^\circ\).
  • \({\sin(\theta + 2\pi) = \sin\theta}\), and \({\cos\theta = \sin(\theta + \pi/2)}\).
  • \({y = A\sin(2\pi t/T + \phi)}\): amplitude \(A\), period \(T\) (frequency \({1/T}\)), and a phase \(\phi\) that moves the wave \({\phi T/(2\pi)}\) earlier.
  • Code: math.sin takes radians. Use math.radians first, or np.sin on an array of radians.

Sources and next steps

Sources. Each was opened and checked against this lesson on 12 November 2026.

  • Jay Abramson and others, Algebra and Trigonometry 2e, Section 7.1 Angles, OpenStax. One radian is the central angle whose arc is as long as the radius; a full revolution of \(360^\circ\) is \(2\pi\) radians; degrees are to 180 as radians are to \(\pi\); an arc cut by an angle of \(\theta\) radians on a circle of radius \(r\) has length \(r\theta\).
  • Jay Abramson and others, Algebra and Trigonometry 2e, Section 8.1 Graphs of the Sine and Cosine Functions, OpenStax. Sine and cosine are periodic with period \(2\pi\); the amplitude is the greatest distance from rest; for \({y = A\sin(Bx - C) + D}\) the period is \({2\pi/\abs{B}}\) and the phase shift is \({C/B}\). In this lesson’s form \(B\) is \({2\pi/T}\) and \(C\) is \({-\phi}\), so the shift is \({-\phi T/(2\pi)}\): the same wave moved \({\phi T/(2\pi)}\) to the left.
  • Python Software Foundation, math — Mathematical functions, Python 3.12 documentation: math.sin(x) returns “the sine of x radians”, and math.radians and math.degrees convert. NumPy reference, numpy.sin: the input is an angle in radians (“\(2\pi\) rad equals 360 degrees”), applied element by element.
  • Rob J. Hyndman and George Athanasopoulos, Forecasting: Principles and Practice, 3rd edition, Section 7.4 Some useful predictors. For a seasonal period \(m\), the first Fourier terms are \({\sin(2\pi t/m)}\) and \({\cos(2\pi t/m)}\) and their multiples, and sine and cosine terms of the right frequencies can approximate any periodic function.
  • Ashish Vaswani and others, Attention Is All You Need, 2017, Section 3.5 Positional Encoding. Positions are encoded with sines and cosines of different frequencies, whose wavelengths form a geometric progression from \(2\pi\) to \({10000 \times 2\pi}\).

Next. M01.5.4 The law of cosines and the angle-addition formulas uses the unit circle to measure any triangle, and to add two angles.

This lesson unlocks

M01.5.4 The law of cosines and the angle-addition formulas

Your progress is saved in this browser only. No account, no tracking.
Back to top