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/tectonics.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'experimental/tectonics/tectonics.h') diff --git a/experimental/tectonics/tectonics.h b/experimental/tectonics/tectonics.h index 85b86fe..b2793e9 100644 --- a/experimental/tectonics/tectonics.h +++ b/experimental/tectonics/tectonics.h @@ -46,6 +46,7 @@ void subdivide(struct quadtree_node_t *node, struct point_t *points); bool insert(struct quadtree_node_t *node, struct point_t *points, int id); int get_closest(struct quadtree_node_t *root, + struct point_t *points, struct point_t pt); void draw_quadtree(cairo_t *cr, struct quadtree_node_t *root); void free_tree(struct quadtree_node_t *root); @@ -59,7 +60,7 @@ void free_tree(struct quadtree_node_t *root); void get_cairo_size(cairo_t *cr, int *width, int *height); double rand01(); -double distance(double x0, double y0, double x1, double y1); +double distance(struct point_t p1, struct point_t p2); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.1