Skip to content

The unit circle

Sine and cosine read off a rotating radius. Drag the angle, or let it run.

examples/showcase-unit-circle.axis

config {
showGrid: true
xAxisStep: 1
yAxisStep: 1
pointsOfInterest: true
}
"The unit circle"
ang = 0.9 @ slider: 0..2pi step 0.005, playing
folder "The circle" {
(cos(t), sin(t)) @ color: BLACK, lineWidth: 2, lineOpacity: 0.5, domain: 0..tau
P = (cos(ang), sin(ang)) @ color: PURPLE, pointSize: 18
"The radius out to P."
R = [(0, 0), P] @ color: PURPLE, lines, points: false, lineWidth: 3
}
folder "Reading off the components" {
"cos is the horizontal leg, sin the vertical one."
A = [(0, 0), (cos(ang), 0)] @ color: RED, lines, points: false, lineWidth: 4
B = [(cos(ang), 0), P] @ color: BLUE, lines, points: false, lineWidth: 4
(cos(ang), 0) @{
color: RED
pointSize: 14
label: "cos"
showLabel
labelOrientation: below
}
(0, sin(ang)) @{
color: BLUE
pointSize: 14
label: "sin"
showLabel
labelOrientation: left
}
}
folder "Unrolled onto the wave" {
"The same angle, plotted along the x-axis to the right of the circle."
y = sin(x - 3) {3 < x < 9.3} @ color: BLUE, lineWidth: 3
(ang + 3, sin(ang)) @ color: BLUE, pointSize: 16
T = [P, (ang + 3, sin(ang))] @{
color: BLUE
lines
points: false
lineStyle: DOTTED
lineOpacity: 0.6
}
}
Open in playground →