From 49751d69498c265cb46f6cce5033367ae39c5e91 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 2 Oct 2024 11:42:40 -0400 Subject: animate --- balls.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 balls.h (limited to 'balls.h') diff --git a/balls.h b/balls.h new file mode 100644 index 0000000..3205959 --- /dev/null +++ b/balls.h @@ -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 -- cgit v1.2.3