From 308fdacff058fe76e9a7cafd05d9f34658645c2a Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sun, 13 Oct 2024 03:50:26 +0200 Subject: Implement Dijkstra's path search example --- graphics.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'graphics.c') diff --git a/graphics.c b/graphics.c index ec86b42..3a4138c 100644 --- a/graphics.c +++ b/graphics.c @@ -312,18 +312,15 @@ b8 rectangle_contains(f64 x0, f64 y0, f64 width, f64 height, f64 px, f64 py) { b8 triangle_contains(f64 x0, f64 y0, f64 x1, f64 y1, f64 x2, f64 y2, f64 px, f64 py) { // Z-components of cross-products // + f64 z0 = (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0); f64 z1 = (x2 - x1) * (y0 - y1) - (x0 - x1) * (y2 - y1); f64 z2 = (x0 - x2) * (y1 - y2) - (x1 - x2) * (y0 - y2); - // Z-components of cross-products - // f64 pz0 = (px - x0) * (y2 - y0) - (x2 - x0) * (py - y0); f64 pz1 = (px - x1) * (y0 - y1) - (x0 - x1) * (py - y1); f64 pz2 = (px - x2) * (y1 - y2) - (x1 - x2) * (py - y2); - // Check signs - // return same_sign(z0, pz0) && same_sign(z1, pz1) -- cgit v1.2.3