com.vividsolutions.jts.algorithm

Class NonRobustCGAlgorithms


public class NonRobustCGAlgorithms
extends CGAlgorithms

Non-robust versions of various fundamental Computational Geometric algorithms, FOR TESTING PURPOSES ONLY!. The non-robustness is due to rounding error in floating point computation.
Version:
1.6

Field Summary

Fields inherited from class com.vividsolutions.jts.algorithm.CGAlgorithms

CLOCKWISE, COLLINEAR, COUNTERCLOCKWISE, LEFT, RIGHT, STRAIGHT

Constructor Summary

NonRobustCGAlgorithms()

Method Summary

static int
computeOrientation(Coordinate p1, Coordinate p2, Coordinate q)
static boolean
isCCW(Coordinate[] ring)
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise.
static boolean
isPointInRing(Coordinate p, Coordinate[] ring)
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise.

Methods inherited from class com.vividsolutions.jts.algorithm.CGAlgorithms

computeOrientation, distanceLineLine, distancePointLine, distancePointLinePerpendicular, isCCW, isOnLine, isPointInRing, length, orientationIndex, signedArea

Constructor Details

NonRobustCGAlgorithms

public NonRobustCGAlgorithms()

Method Details

computeOrientation

public static int computeOrientation(Coordinate p1,
                                     Coordinate p2,
                                     Coordinate q)
Overrides:
computeOrientation in interface CGAlgorithms

isCCW

public static boolean isCCW(Coordinate[] ring)
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise.

This will handle coordinate lists which contain repeated points.

Overrides:
isCCW in interface CGAlgorithms
Parameters:
ring - an array of coordinates forming a ring
Returns:
true if the ring is oriented counter-clockwise.

isPointInRing

public static boolean isPointInRing(Coordinate p,
                                    Coordinate[] ring)
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise.

This will handle coordinate lists which contain repeated points.

Overrides:
isPointInRing in interface CGAlgorithms
Parameters:
ring - an array of coordinates forming a ring
Returns:
true if the ring is oriented counter-clockwise.