diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-10-02 11:42:40 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-10-02 11:42:40 -0400 |
| commit | 49751d69498c265cb46f6cce5033367ae39c5e91 (patch) | |
| tree | 5dc5293c2c3e5bc0ccfbcfd4ed3bdc311ee38364 /balls.h | |
| parent | 66559ba8c23e5d1591336a703785a7bc42e98f2d (diff) | |
| download | balls-49751d69498c265cb46f6cce5033367ae39c5e91.zip | |
animate
Diffstat (limited to 'balls.h')
| -rw-r--r-- | balls.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +typedef struct { + double x, y; +} Point; + +typedef struct { + Point min, max; +} Rectangle; + +typedef struct { + double x, y; +} Vector; + +typedef struct { + Point p; /* position [m] */ + Vector v; /* velocity [m/s] */ + double m; /* mass [kg] */ + double r; /* radius [m] */ +} Ball; + +Point ptAddVec(Point p, Vector v); +Rectangle insetRect(Rectangle r, double n); + +void collideWall(Ball *b, Rectangle wall);
\ No newline at end of file |