Harmonische schwingung als graphen

Hallo,

ich bin dabei eine harmonische Schwingung mit Java darzustellen. Allerdings erhalte ich dabei keinen sinnvollen Graphen und weiß nicht wieso :.

double ds = 10;
double a = ds;
double mm = 30;
double dd = 50;
double dv = 0;
double T =0.1;
int anz =1000;
double dt = T/anz;
double da;
double old = 0;
g.setColor(Color.RED);
for (double t = 0; t

Ich habe vergessen hinzuzufügen das mein Fenster 500*500 breit ist und somit das Koordinatensystem, das ich zeichne, x=0 und y=0 bei 250 250 hat.