public class CGAlgorithms extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CLOCKWISE
A value that indicates an orientation of clockwise, or a right turn.
|
static int |
COLLINEAR
A value that indicates an orientation of collinear, or no turn (straight).
|
static int |
COUNTERCLOCKWISE
A value that indicates an orientation of counterclockwise, or a left turn.
|
static int |
LEFT
A value that indicates an orientation of counterclockwise, or a left turn.
|
static int |
RIGHT
A value that indicates an orientation of clockwise, or a right turn.
|
static int |
STRAIGHT
A value that indicates an orientation of collinear, or no turn (straight).
|
| Constructor and Description |
|---|
CGAlgorithms() |
| Modifier and Type | Method and Description |
|---|---|
static double |
distancePointLinePerpendicular(Point p,
Point A,
Point B)
Computes the perpendicular distance from a point p to the (infinite) line
containing the points AB
|
static boolean |
isCCW(Point[] ring)
Computes whether a ring defined by an array of
Coordinatess is
oriented counter-clockwise. |
static boolean |
isOnLine(Point p,
LineString line)
Tests whether a point lies on the line segments defined by a list of
coordinates.
|
static boolean |
isPointInRing(Point point,
LineString ring) |
public static final int CLOCKWISE
public static final int RIGHT
public static final int COUNTERCLOCKWISE
public static final int LEFT
public static final int COLLINEAR
public static final int STRAIGHT
public static double distancePointLinePerpendicular(Point p, Point A, Point B)
p - the point to compute the distance forA - one point of the lineB - another point of the line (must be different to A)public static boolean isCCW(Point[] ring)
Coordinatess is
oriented counter-clockwise.
ring - an array of Point forming a ringIllegalArgumentException - if there are too few points to determine orientation (< 4)public static boolean isOnLine(Point p, LineString line)
public static boolean isPointInRing(Point point, LineString ring)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.