From 93a3f005480effe48513e7bc81161db1adc43f32 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Mon, 28 Oct 2024 11:09:12 -0400 Subject: move --- geo.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'geo.c') diff --git a/geo.c b/geo.c index 60c0ae2..84c73cf 100644 --- a/geo.c +++ b/geo.c @@ -1,10 +1,5 @@ -#include -#include - #include "balls.h" -static float randFloat(float lo, float hi); - int isCollision(float2 p1, float r1, float2 p2, float r2) { float2 dist; @@ -21,27 +16,3 @@ insetRect(Rectangle r, float n) { r.max -= n; return r; } - -float2 -randPtInRect(Rectangle r) { - float2 pt = { - randFloat(r.min[0], r.max[0]), - randFloat(r.min[1], r.max[1]) - }; - return pt; -} - -static float -randFloat(float lo, float hi) { - float r, diff; - static int isInitialized = 0; - - if (!isInitialized) { /* First call. */ - srand(time(0)); - isInitialized = 1; - } - - r = (float) rand() / RAND_MAX; - diff = hi - lo; - return lo + r*diff; -} -- cgit v1.2.3