diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-10-13 03:50:26 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-10-13 03:50:26 +0200 |
commit | 308fdacff058fe76e9a7cafd05d9f34658645c2a (patch) | |
tree | d7dfb57bcc82085f5033a8af97a1d9464430871f /graphics.c | |
parent | fc7986d7218a1b86fa4f931466d4f7d9bcb719cc (diff) | |
download | reduced_system_layer-308fdacff058fe76e9a7cafd05d9f34658645c2a.zip |
Implement Dijkstra's path search example
Diffstat (limited to 'graphics.c')
-rw-r--r-- | graphics.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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) |