diff options
author | sanine <sanine.not@pm.me> | 2022-01-26 00:41:47 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-26 00:41:47 -0600 |
commit | c5fae17327c585ec09ad01066e3f24a4e7be1fed (patch) | |
tree | 3d43dc6e9d4b7361616c0c8e3aeba01de5c88830 /experimental/tectonics/util.c | |
parent | 3c0ee746d9d2822c1bf04e76267c14785b4d54df (diff) |
fix bug in getting closest point
Diffstat (limited to 'experimental/tectonics/util.c')
-rw-r--r-- | experimental/tectonics/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |