siteIcon

Tech Novice Tools

Processing Apps

burgerIcon

Sinusoidbug

"♫ ...spinning wheel...got to go round...♪"

Instructions

Sinusoids are used to model events in the 'real world' that are cyclical or 'periodic.'

They can be generated by a point moving on a circle at a uniform rate.

The equation for a sinusoid as a function of time, t, is:

y = f(t) = A*cos(B*(t-D)) + C

The 'players' in the function (in order of simplicity) are:

  • A: Amplitude: Maximum distance above/below the axis of the wave shape
  • C: Sinusoidal Axis: The horizontal line about which the wave oscillates. It is the average value of the maximum and minimum values of the wave.
  • D: Horizontal Shift: The horizontal distance the wave is shifted as it begins its journey.
  • B: Quasi-Period; B is related to period via the equation: B = 2π/P . Period is the horizontal distance between adjacent peaks or valleys of the wave. Period is inversely proportional to frequency.

The function is shown as a cosine, but it could have equally been a sine.

In the animation below, the radius of the green circle determines the amplitude of the wave; its location determines the placement of the wave's axis. The starting position of the yellow point establishes the horizontal shift of the wave, and the speed of the point on the wheel determines the period.

The slider determines the angular speed of the point.

Note: Thanks to Peter Farrell and his book: Math Adventures with Python (No Starch Press) for inspiring this app. He described it in Python3 and it was so cool we just had to write it in JavaScript. A movie (and source code) of the Python3 code in action is here at TNT as well.

Last update: 09/19/19


Point Speed: