GEOS  3.8.0dev
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
geos::algorithm::CGAlgorithmsDD Class Reference

Implements basic computational geometry algorithms using extended precision float-point arithmetic. More...

#include <CGAlgorithmsDD.h>

Public Types

enum  { CLOCKWISE = -1, COLLINEAR = 0, COUNTERCLOCKWISE = 1 }
 
enum  { RIGHT = -1, LEFT = 1, STRAIGHT = 0, FAILURE = 2 }
 

Static Public Member Functions

static int orientationIndex (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q)
 
static int orientationIndexFilter (const geom::Coordinate &pa, const geom::Coordinate &pb, const geom::Coordinate &pc)
 
static int orientation (double x)
 
static void intersection (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q1, const geom::Coordinate &q2, geom::Coordinate &rv)
 
static int signOfDet2x2 (double dx1, double dy1, double dx2, double dy2)
 

Static Protected Member Functions

static int signOfDet2x2 (DD &x1, DD &y1, DD &x2, DD &y2)
 

Detailed Description

Implements basic computational geometry algorithms using extended precision float-point arithmetic.

Member Function Documentation

static int geos::algorithm::CGAlgorithmsDD::orientationIndex ( const geom::Coordinate p1,
const geom::Coordinate p2,
const geom::Coordinate q 
)
static

Returns the index of the direction of the point q relative to a vector specified by p1-p2.

Parameters
p1the origin point of the vector
p2the final point of the vector
qthe point to compute the direction to
Returns
1 if q is counter-clockwise (left) from p1-p2
-1 if q is clockwise (right) from p1-p2
0 if q is collinear with p1-p2
static int geos::algorithm::CGAlgorithmsDD::orientationIndexFilter ( const geom::Coordinate pa,
const geom::Coordinate pb,
const geom::Coordinate pc 
)
static

A filter for computing the orientation index of three coordinates.

If the orientation can be computed safely using standard DP arithmetic, this routine returns the orientation index. Otherwise, a value i > 1 is returned. In this case the orientation index must be computed using some other more robust method. The filter is fast to compute, so can be used to avoid the use of slower robust methods except when they are really needed, thus providing better average performance.

Uses an approach due to Jonathan Shewchuk, which is in the public domain.

Parameters
paa coordinate
pba coordinate
pca coordinate
Returns
the orientation index if it can be computed safely
i > 1 if the orientation index cannot be computed safely

The documentation for this class was generated from the following file: