Skip to content
Snippets Groups Projects
Commit c0730e50 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the computation of the angle between segments.

parent 0aa1cee1
No related branches found
No related tags found
1 merge request!2Solved a bug when creating a new geometry object: the sale factor is...
...@@ -280,7 +280,7 @@ double COSMNode::compute_angle(const COSMNode &node1,const COSMNode &node2) cons ...@@ -280,7 +280,7 @@ double COSMNode::compute_angle(const COSMNode &node1,const COSMNode &node2) cons
node2.get_location(end_x,end_y); node2.get_location(end_x,end_y);
dist12=node1.compute_distance(node2); 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)); angle=acos((pow(dist01,2.0)+pow(dist02,2.0)-pow(dist12,2.0))/(2.0*dist01*dist02));
if(cross>=0.0) if(cross>=0.0)
angle=-angle; angle=-angle;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment