summaryrefslogtreecommitdiffstats
path: root/balls.cpp
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-10-09 17:00:53 -0400
committerSam Anthony <sam@samanthony.xyz>2024-10-09 17:00:53 -0400
commit20622555ee6eabb3d3c9f618d65b91736dd7097f (patch)
treeabe6faf05b22909c050449084e0c28f7158a6231 /balls.cpp
parentf48d24f99849fb9e801970bcb124cd49fa2418f6 (diff)
downloadballs-20622555ee6eabb3d3c9f618d65b91736dd7097f.zip
refactor
Diffstat (limited to 'balls.cpp')
-rw-r--r--balls.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/balls.cpp b/balls.cpp
index 2c8172f..b3f245d 100644
--- a/balls.cpp
+++ b/balls.cpp
@@ -35,7 +35,6 @@ vector<Point> noOverlapCircles(unsigned int n);
double mass(double radius);
double volume(double radius);
void animate(int v);
-Color randColor(void);
const static Rectangle bounds = {{-1.5, -1.0}, {1.5, 1.0}};
@@ -217,28 +216,3 @@ animate(int v) {
display();
glutTimerFunc(FRAME_TIME_MS, animate, 0);
}
-
-double
-randDouble(double lo, double hi) {
- double r, diff;
- static int isInitialized = 0;
-
- if (!isInitialized) { /* first call */
- srand(time(0));
- isInitialized = 1;
- }
-
- r = (double) rand() / (double) RAND_MAX;
- diff = hi - lo;
- return lo + r*diff;
-}
-
-Color
-randColor(void) {
- Color color;
-
- color.r = randDouble(0, 1);
- color.g = randDouble(0, 1);
- color.b = randDouble(0, 1);
- return color;
-}