C++:Simple Harmonic Motion

From Progzoo
Jump to: navigation, search

Simple Harmonic Motion

We can move items independantly or each other.

In this code there are 3 cubes. The movement of each is controlled by six parameters:

  • x0
    • The x coordinate of the centre of the motion
  • y0
    • The y coordinate of the centre of the motion
  • z0
    • The z coordinate of the centre of the motion
  • xa
    • The amplitude of the oscillation
  • xtheta
    • The angular velocity in degrees per second (if you set this at 360 it will complete one cycle every second)
  • xdelta
    • The phase of the oscillation in degrees

Try some different values for the array shm


[Font] [Default] [Show] [Resize] [History] [Profile]