From 68bddfa8825678d90e2c4c6d325e46b360ac1600 Mon Sep 17 00:00:00 2001
From: Pablo Vasconez
Date: Fri, 10 Nov 2023 13:48:26 +0100
Subject: [PATCH] fix(#17): fix of formula to calculate the z-coordinate of
plane at x,y coordinates.
---
src/plxcontroller/geometry_3d/operations_3d.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plxcontroller/geometry_3d/operations_3d.py b/src/plxcontroller/geometry_3d/operations_3d.py
index 4cc7f36..3e6a03f 100644
--- a/src/plxcontroller/geometry_3d/operations_3d.py
+++ b/src/plxcontroller/geometry_3d/operations_3d.py
@@ -57,7 +57,7 @@ def project_vertically_point_onto_polygon_3d(
# point x and y coordinates input
a, b, c, d = plane.cartesian()
if not np.isclose(c, 0.0):
- z = (d - a * point.x - b * point.y) / c
+ z = (-d - a * point.x - b * point.y) / c
else:
# if the coefficient c is close to zero, it means that
# the plane is parallel to the z-axis, so the z-coordinate