From c5fae17327c585ec09ad01066e3f24a4e7be1fed Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 26 Jan 2022 00:41:47 -0600 Subject: fix bug in getting closest point --- experimental/tectonics/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'experimental/tectonics/util.c') diff --git a/experimental/tectonics/util.c b/experimental/tectonics/util.c index a0a32a3..991ebc6 100644 --- a/experimental/tectonics/util.c +++ b/experimental/tectonics/util.c @@ -16,10 +16,10 @@ double rand01() } -double distance(double x0, double y0, double x1, double y1) +double distance(struct point_t p1, struct point_t p2) { - double dx = x1-x0; - double dy = y1-y0; + double dx = p1.x-p2.x; + double dy = p1.y-p2.y; return sqrt(dx*dx + dy*dy); } -- cgit v1.2.1