mirror of
https://github.com/StevenMcLeod/pendulum68k.git
synced 2024-05-28 06:41:32 +00:00
1 line
251 B
C
1 line
251 B
C
#include "pendulum.h"
|
|
#include <math.h>
|
|
|
|
double pendulum_iter(struct pendulum_t *p) {
|
|
double dd_theta = -(p->mu * p->d_theta) - (p->gl * sin(p->theta));
|
|
p->d_theta += dd_theta * p->timestep;
|
|
p->theta += p->d_theta * p->timestep;
|
|
return p->theta;
|
|
} |