A Gentle Introduction to SQL Simple Harmonic Motion

# What's the point of Trigonometry?

## ( x0+xscos(ωxt+δx), y0+yssin(ωyt+δy) )

The following SQL statement generates 20 rows. Each row includes eight numbers that control the movement of one of 20 points.

### Have a go

In this example the first parameter x0 is the only one which changes - it varies from -300 in the first row to 270 in the last. This means that the points are distributed evenly across the x-axis.

Some things to try...

• ys is 200 for all points - this gives amplitude of the motion. Try changing this to 300 - notice that the points go to the very top of the applet.
• ωy (wy) is 1 - this dictates the speed of the motion change this to 3 to speed it up a bit.
• δy (dy) controls the phase. We can put the points out of phase - try the following values:
• i
• 18*i
• -18*i
• 180*i
• 185*i

### Angular velocity

Not much to change here - we have more points and each has a different angular velocity. Watch the harmonics as different groups drift in and out of phase

Some things to try...

• If a nineth parameter is equal to 1 then a straight line is drawn instead of a circle. Put ,1 after dy

### Lissajous

Lissajous figures are formed when sinusoidal motion is applied to both the x and the y axis.

Some things to try...

• Try changing the phase factors 2 and 5
• Look for a relation between these numbers and the pattern, you can freeze the animation.

### Cube

We can generate (x,y,z) points for a cube by taking the triple Cartesian product of n. The sin and cos in the inner SQL tilt this cube. We flatten these into 2D and make the phase correspond to the angle each point makes with the xz plane.

Some things to try...

• Change the angle of tilt (currently .2)
• Add more points to the cube.