From c0730e502fcd1d7db8ea582559977c16039bf2b3 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Wed, 31 May 2023 16:23:42 +0200
Subject: [PATCH] Solved a bug in the computation of the angle between
 segments.

---
 src/osm/osm_node.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/osm/osm_node.cpp b/src/osm/osm_node.cpp
index 5869e02..065a94d 100644
--- a/src/osm/osm_node.cpp
+++ b/src/osm/osm_node.cpp
@@ -280,7 +280,7 @@ double COSMNode::compute_angle(const COSMNode &node1,const COSMNode &node2) cons
   node2.get_location(end_x,end_y);
   dist12=node1.compute_distance(node2);
 
-  cross=(end_x-start_x)*(this->location.y-start_y)-(end_y-start_y)*(this->location.x-start_x);  
+  cross=(this->location.x-start_x)*(end_y-start_y)-(this->location.y-start_y)*(end_x-start_x);  
   angle=acos((pow(dist01,2.0)+pow(dist02,2.0)-pow(dist12,2.0))/(2.0*dist01*dist02));
   if(cross>=0.0)
     angle=-angle;
-- 
GitLab