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

Solved a bug in the angle normalization function.

parent 1de13af8
No related branches found
No related tags found
No related merge requests found
#include "g2_spline.h" #include "g2_spline.h"
#include <math.h> #include <math.h>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <iostream>
CG2Spline::CG2Spline() CG2Spline::CG2Spline()
{ {
...@@ -114,9 +113,9 @@ CG2Spline::CG2Spline(TPoint &start,TPoint &end) ...@@ -114,9 +113,9 @@ CG2Spline::CG2Spline(TPoint &start,TPoint &end)
void CG2Spline::normalize_angle(double &angle) void CG2Spline::normalize_angle(double &angle)
{ {
if(angle>3.14159) if(angle>3.14159)
angle-=3.14159; angle-=2*3.14159;
else if(angle<-3.14159) else if(angle<-3.14159)
angle+=3.14159; angle+=2*3.14159;
} }
double CG2Spline::find_parameter(double length) double CG2Spline::find_parameter(double length)
......
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