21#include <geos/export.h>
22#include <geos/math/DD.h>
29class CoordinateSequence;
68 const geom::CoordinateXY& p2,
69 const geom::CoordinateXY& q);
72 static int orientationIndex(
double p1x,
double p1y,
73 double p2x,
double p2y,
74 double qx,
double qy);
98 double pax,
double pay,
99 double pbx,
double pby,
100 double pcx,
double pcy)
102 double const detleft = (pax - pcx) * (pby - pcy);
103 double const detright = (pay - pcy) * (pbx - pcx);
104 double const det = detleft - detright;
106 double const error = std::abs(detleft + detright)
107 * 3.3306690621773724e-16;
108 if (std::abs(det) >= error)
109 return (det > 0) - (det < 0);
110 return CGAlgorithmsDD::FAILURE;
114 orientation(
double x)
117 return CGAlgorithmsDD::RIGHT;
120 return CGAlgorithmsDD::LEFT;
122 return CGAlgorithmsDD::STRAIGHT;
134 static geom::CoordinateXY
intersection(
const geom::CoordinateXY& p1,
const geom::CoordinateXY& p2,
135 const geom::CoordinateXY& q1,
const geom::CoordinateXY& q2);
137 static int signOfDet2x2(
double dx1,
double dy1,
double dx2,
double dy2);
139 static DD detDD(
double x1,
double y1,
double x2,
double y2);
140 static DD detDD(
const DD& x1,
const DD& y1,
const DD& x2,
const DD& y2);
161 static geom::CoordinateXY
circumcentreDD(
const geom::CoordinateXY& a,
const geom::CoordinateXY& b,
const geom::CoordinateXY& c);
165 static int signOfDet2x2(
const DD& x1,
const DD& y1,
const DD& x2,
const DD& y2);
Implements basic computational geometry algorithms using extended precision float-point arithmetic.
Definition CGAlgorithmsDD.h:37
static int orientationIndexFilter(double pax, double pay, double pbx, double pby, double pcx, double pcy)
Definition CGAlgorithmsDD.h:97
static int orientationIndex(const geom::CoordinateXY &p1, const geom::CoordinateXY &p2, const geom::CoordinateXY &q)
Returns the index of the direction of the point q relative to a vector specified by p1-p2.
static geom::CoordinateXY circumcentreDD(const geom::CoordinateXY &a, const geom::CoordinateXY &b, const geom::CoordinateXY &c)
Computes the circumcentre of a triangle.
static geom::CoordinateXY intersection(const geom::CoordinateXY &p1, const geom::CoordinateXY &p2, const geom::CoordinateXY &q1, const geom::CoordinateXY &q2)
Wrapper for DoubleDouble higher precision mathematics operations.
Definition DD.h:108
Basic namespace for all GEOS functionalities.
Definition geos.h:39