public class LineSegmentUtil extends Object
| Constructor and Description |
|---|
LineSegmentUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Point |
closestPoint(Point lineStart,
Point lineEnd,
Point point) |
static double |
det(double a,
double b,
double c,
double d) |
static double |
distanceLineLine(double line1X1,
double line1Y1,
double line1X2,
double line1Y2,
double line2X1,
double line2Y1,
double line2X2,
double line2Y2)
Computes the distance from a line segment AB to a line segment CD
Note: NON-ROBUST!
|
static double |
distanceLineLine(Point line1From,
Point line1To,
Point line2From,
Point line2To) |
static double |
distanceLinePoint(double x1,
double y1,
double x2,
double y2,
double x,
double y)
Calculate the distance between the line from x1,y1 to x2,y2 and the point
x,y.
|
static double |
distanceLinePoint(Point lineStart,
Point lineEnd,
Point point)
Calculate the distance between the line from lineStart to lineEnd and the
point.
|
static boolean |
envelopeIntersects(double x1,
double y1,
double x2,
double y2,
double x,
double y)
Check to see if the point (x,y) intersects the envelope of the line from
(x1,y1) to (x2,y2).
|
static boolean |
envelopeIntersects(Point lineStart,
Point lineEnd,
Point point)
Check to see if the point intersects the envelope of the line from
lineStart to lineEnd.
|
static boolean |
envelopeIntersects(Point line1Start,
Point line1End,
Point line2Start,
Point line2End)
Check to see if the envelope one the line from line1Start to line1End
intersects the envelope of the line from line2Start to line2End.
|
static Point |
getElevation(GeometryFactory geometryFactory,
Point lineStart,
Point lineEnd,
Point point) |
static double |
getElevation(Point lineStart,
Point lineEnd,
Point point) |
static LineString |
getIntersection(GeometryFactory geometryFactory,
Point line1Start,
Point line1End,
Point line2Start,
Point line2End)
Get the intersection between line (segment) 1 and line (segment) 2.
|
static boolean |
intersects(Point line1p1,
Point line1p2,
Point line2p1,
Point line2p2) |
static boolean |
isPointOnLine(double x1,
double y1,
double x2,
double y2,
double x,
double y,
double maxDistance) |
static boolean |
isPointOnLine(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd,
Point point)
Check to see if the point is on the line between lineStart and lineEnd
using the precision model to see if a line split at the projection of the
point on the line would be the same point.
|
static boolean |
isPointOnLine(Point lineStart,
Point lineEnd,
Point point,
double maxDistance) |
static boolean |
isPointOnLineMiddle(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd,
Point point) |
static Point |
midPoint(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd) |
static Point |
midPoint(Point lineStart,
Point lineEnd) |
static int |
orientationIndex(Point lineStart,
Point lineEnd,
Point point) |
static double |
orientedAngleBetween2d(Point start,
Point line1End,
Point line2End)
Calculate the counter clockwise angle in radians of the difference between
the two vectors from the start point and line1End and line2End.
|
static Point |
pointAlong(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd,
Point point) |
static Point |
pointAlong(Point p0,
Point p1,
double segmentLengthFraction) |
static Point |
project(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd,
double r) |
static Point |
project(GeometryFactory precisionModel,
Point lineStart,
Point lineEnd,
Point point) |
static Point |
project(int axisCount,
Point lineStart,
Point lineEnd,
double r) |
static double |
projectionFactor(double x1,
double y1,
double x2,
double y2,
double x,
double y)
Calculate the projection factor of the distance of the point (x,y)
coordinates along the line (x1,y1 -> x2,y2).
|
static double |
projectionFactor(Point lineStart,
Point lineEnd,
Point point)
Calculate the projection factor of the distance of the point coordinates
along the line.
|
static double |
segmentFraction(Point lineStart,
Point lineEnd,
Point point) |
public static double det(double a,
double b,
double c,
double d)
public static double distanceLineLine(double line1X1,
double line1Y1,
double line1X2,
double line1Y2,
double line2X1,
double line2Y1,
double line2X2,
double line2Y2)
A - a point of one lineB - the second point of (must be different to A)C - one point of the lineD - another point of the line (must be different to A)public static double distanceLineLine(Point line1From, Point line1To, Point line2From, Point line2To)
public static double distanceLinePoint(double x1,
double y1,
double x2,
double y2,
double x,
double y)
x1 - The x coordinate at the start of the line.y1 - The y coordinate at the start of the line.x2 - The x coordinate at the end of the line.y2 - The y coordinate at the end of the line.x - The x coordinate of the point.y - The y coordinate of the point.public static double distanceLinePoint(Point lineStart, Point lineEnd, Point point)
lineStart - The point at the start of the line.lineEnd - The point at the end of the line.point - The point.point - The coordinates of the point location.public static boolean envelopeIntersects(double x1,
double y1,
double x2,
double y2,
double x,
double y)
x1 - The x coordinate at the start of the line.y1 - The y coordinate at the start of the line.x2 - The x coordinate at the end of the line.y2 - The y coordinate at the end of the line.x - The x coordinate of the point.y - The y coordinate of the point.public static boolean envelopeIntersects(Point lineStart, Point lineEnd, Point point)
lineStart - The point at the start of the line.lineEnd - The point at the end of the line.point - The point.public static boolean envelopeIntersects(Point line1Start, Point line1End, Point line2Start, Point line2End)
line1Start - The point at the start of the first line.line1End - The point at the end of the first line.line2Start - The point at the start of the second line.line2End - The point at the end of the second line.public static Point getElevation(GeometryFactory geometryFactory, Point lineStart, Point lineEnd, Point point)
public static LineString getIntersection(GeometryFactory geometryFactory, Point line1Start, Point line1End, Point line2Start, Point line2End)
geometryFactory - line1Start - line1End - line2Start - line2End - public static boolean intersects(Point line1p1, Point line1p2, Point line2p1, Point line2p2)
public static boolean isPointOnLine(double x1,
double y1,
double x2,
double y2,
double x,
double y,
double maxDistance)
public static boolean isPointOnLine(GeometryFactory precisionModel, Point lineStart, Point lineEnd, Point point)
precisionModel - The precision model.lineStart - The point at the start of the line.lineEnd - The point at the end of the line.point - The point.public static boolean isPointOnLine(Point lineStart, Point lineEnd, Point point, double maxDistance)
public static boolean isPointOnLineMiddle(GeometryFactory precisionModel, Point lineStart, Point lineEnd, Point point)
public static Point midPoint(GeometryFactory precisionModel, Point lineStart, Point lineEnd)
public static double orientedAngleBetween2d(Point start, Point line1End, Point line2End)
public static Point pointAlong(GeometryFactory precisionModel, Point lineStart, Point lineEnd, Point point)
public static Point project(GeometryFactory precisionModel, Point lineStart, Point lineEnd, double r)
public static Point project(GeometryFactory precisionModel, Point lineStart, Point lineEnd, Point point)
public static double projectionFactor(double x1,
double y1,
double x2,
double y2,
double x,
double y)
x1 - The x coordinate for the start of the line.y1 - The y coordinate for the start of the line.x2 - The x coordinate for the end of the line.y2 - The y coordinate for the end of the line.x - The x coordinate for the point.y - The y coordinate for the point.public static double projectionFactor(Point lineStart, Point lineEnd, Point point)
lineStart - The start coordinates of the line.lineEnd - The end coordinates of the line.point - The point coordinates.Copyright © 2015 Revolution Systems Inc.. All rights reserved.