#include #define NPOINTS 4000 double pos[NPOINTS]; double vel[NPOINTS]; // // Fill pos/vel with the trajectory of a damped harmonic oscillator // (semi-implicit Euler integration). // void integrate (double damping) { double x = 1.0; double v = 0.0; double w = 1.0; double dt = 0.005; for (int i=0; i