Trigonometry · Sinusoidal function

Sinusoidal function

A sinusoidal function y = A sin(ωx + φ) + k (A ≠ 0, ω > 0) is a stretched and shifted sine wave. Change its amplitude, period, phase and midline, and see what each parameter controls.

01

Sinusoidal functions in this visualization

A sinusoidal function, or sinusoid, is a function of the form y=Asin⁡(ωx+φ)+ky = A\sin(\omega x + \varphi) + k with A≠0A \ne 0 and ω>0\omega > 0: the graph of sin⁡x\sin x stretched, squeezed and shifted. Also written Asin⁡(B(x−C))+DA\sin\big(B(x - C)\big) + D, with B=ωB = \omega, C=−φ/ωC = -\varphi/\omega, D=kD = k. Cosine curves are sinusoids too, because cos⁡x=sin⁡(x+π/2)\cos x = \sin(x + \pi/2). The panel turns AA and ω\omega on knobs (ω\omega from ½ to 4) and slides the shift −φ/ω-\varphi/\omega and kk on faders.

The dashed curve is the parent y=sin⁡xy = \sin x; the solid curve is the function on the panel. The yellow marks measure what the parameters set, one job each:

Four parameters, four jobs
amplitude=∣A∣,period=2πω,shift=−φω,midline y=k.\text{amplitude} = |A|, \quad \text{period} = \frac{2\pi}{\omega}, \quad \text{shift} = -\frac{\varphi}{\omega}, \quad \text{midline } y = k.

The vertical bracket runs from the midline to a peak (to a trough when A<0A < 0). The horizontal bracket spans one period. The arrow along the midline goes from x=0x = 0 to x=−φ/ωx = -\varphi/\omega, where sin x's cycle now starts. The blue dots are the five key points of that cycle, where ωx+φ\omega x + \varphi equals 0,π/2,π,3π/20, \pi/2, \pi, 3\pi/2 and 2π2\pi: the start, the extreme y=k+Ay = k + A, the midline, the extreme y=k−Ay = k - A and the end — a peak first and then a trough when A>0A > 0, the other way round when A<0A < 0.

02

Things to notice

  • Inside the parentheses, changes act sideways and seem backwards: ω=2\omega = 2 makes the period shorter (π\pi, not 4π4\pi), and a negative φ\varphi moves the curve to the right.
  • Turning ω\omega squeezes or stretches the curve about the start of its cycle, x=−φ/ωx = -\varphi/\omega: the page keeps that shift while ω\omega turns, so φ=−ω⋅(shift)\varphi = -\omega\cdot(\text{shift}) changes with it.
  • The curve swings between k−∣A∣k - |A| and k+∣A∣k + |A|, with the midline halfway. A negative AA flips it over the midline; the amplitude is still ∣A∣|A|.
03

Reading it correctly

  • The shift is −φ/ω-\varphi/\omega, not −φ-\varphi: sin⁡(2x−2π/3)=sin⁡(2(x−π/3))\sin(2x - 2\pi/3) = \sin\big(2(x - \pi/3)\big) is sin⁡2x\sin 2x shifted π/3\pi/3 to the right. Shifting first works too: move sin⁡x\sin x by −φ-\varphi, then divide the x-coordinates by ω\omega, which divides the shift as well.
  • The period depends only on ω\omega, the amplitude only on AA. With A=0A = 0 the function is the constant kk: the amplitude is 0, nothing oscillates and there is no least period, so the period and φ\varphi read as dashes. φ\varphi is computed from the shift and not reduced to any interval; φ\varphi and φ+2nπ\varphi + 2n\pi draw the same curve.
  • The page keeps ω\omega positive. A negative ω\omega adds nothing new: since sin⁡(−u)=−sin⁡u\sin(-u) = -\sin u, replace ω\omega by ∣ω∣|\omega|, AA by −A-A and φ\varphi by −φ-\varphi.
04

Sketching by key points

  • Setting ωx+φ\omega x + \varphi to 0,π/2,π,3π/2,2π0, \pi/2, \pi, 3\pi/2, 2\pi gives x=s, s+T/4, s+T/2, s+3T/4, s+Tx = s,\ s + T/4,\ s + T/2,\ s + 3T/4,\ s + T with s=−φ/ωs = -\varphi/\omega and T=2π/ωT = 2\pi/\omega, and there y=k, k+A, k, k−A, ky = k,\ k + A,\ k,\ k - A,\ k. Plotting these five points and joining them smoothly is the usual way to sketch one cycle by hand. The Key points table on the panel lists them for the function on the panel; point at a column to light its point on the graph.
05

Controls

  • AA and ω\omega on knobs; the shift −φ/ω-\varphi/\omega on a fader that slides sideways (−π-\pi to π\pi, snapping to multiples of π/12\pi/12) and kk on one that slides up and down — the way the curve moves. Click a value to type it (the shift accepts π/6, 2π/3, -pi/4 or radians). Under the shift, “≡” gives the same curve's shift the other way: shifts a whole period apart draw one curve.
  • On the graph, drag the start of a cycle to shift the curve, its first extreme up or down to change AA, and its end sideways to change the period.
  • Presentation mode opens a full-screen view for projectors (← → shift the curve by π/12\pi/12, ↑ ↓ move the midline by 0.5, H hides the measured values).
06

Related