Commit 909af542 authored by Alexandre Halbach's avatar Alexandre Halbach

Check geo

parent 681c44ca
#include "geotools.h"
double geotools::acos(double arg)
{
double pi = 3.1415926535897932384;
if (arg >= 1)
return 0.0;
if (arg <= -1)
return pi;
if (std::abs(arg) < 1)
return std::acos(arg);
}
std::vector<std::shared_ptr<rawshape>> geotools::coordstopoints(std::vector<double> coords)
{
if (coords.size()%3 == 0)
......
......@@ -20,6 +20,9 @@
namespace geotools
{
// An implementation of acos that is safe with respect to roundoff noise on the argument:
double acos(double arg);
// Convert a list of point coordinates into point objects:
std::vector<std::shared_ptr<rawshape>> coordstopoints(std::vector<double> coords);
......
......@@ -136,8 +136,8 @@ void rawarc::mesh(void)
// Get the angle with the x axis of the first and last point on the arc:
double angle1 = std::acos((p1coords[0]-pccoords[0])/radius);
double angle2 = std::acos((p2coords[0]-pccoords[0])/radius);
double angle1 = geotools::acos((p1coords[0]-pccoords[0])/radius);
double angle2 = geotools::acos((p2coords[0]-pccoords[0])/radius);
if (p1coords[1] < pccoords[1])
angle1 = -angle1;
if (p2coords[1] < pccoords[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment