## org.onebusaway.geospatial.services Class GeometryLibrary

java.lang.Object
org.onebusaway.geospatial.services.GeometryLibrary

public class GeometryLibrary
extends Object

Constructor Summary
GeometryLibrary()

Method Summary
static


double

distance(P a, P b)

static


double

getAngle(P origin, P a, P b)

static double getRelativeAngleDifference(double from, double to)

static boolean inRange(double r1, double r2, double v)

static


boolean

isBetween(P point, P lineStart, P lineEnd)
Consider a line segment defined by points 'lineStart' and 'lineEnd'.
Angle Methods
static


P

projectPointToLine(P point, P lineStart, P lineEnd)

static


P

projectPointToSegment(P point, P segmentStart, P segmentEnd)

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

### GeometryLibrary

public GeometryLibrary()
Method Detail

### inRange

public static final boolean inRange(double r1,
double r2,
double v)

Angle Methods

### getRelativeAngleDifference

public static double getRelativeAngleDifference(double from,
double to)

### distance

public static <P extends Point> double distance(P a,
P b)

### getAngle

public static <P extends Point> double getAngle(P origin,
P a,
P b)

### projectPointToLine

public static <P extends Point> P projectPointToLine(P point,
P lineStart,
P lineEnd)

### projectPointToSegment

public static <P extends Point> P projectPointToSegment(P point,
P segmentStart,
P segmentEnd)

### isBetween

public static <P extends Point> boolean isBetween(P point,
P lineStart,
P lineEnd)
Consider a line segment defined by points 'lineStart' and 'lineEnd'. Consider two planes, each perpendicular to the line segment and each intersecting one of the endpoints of the segment. Method returns true when the target 'point' falls on or between these two planes.

Parameters:
point -
lineStart -
lineEnd -
Returns: