diff options
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 |