public class Geo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
KPH_TO_MPS |
static float |
MPH_TO_MPS |
static float |
MPS_TO_MPH |
static double |
RADIUS_OF_EARTH_IN_METERS |
Constructor and Description |
---|
Geo() |
Modifier and Type | Method and Description |
---|---|
static float |
converKmPerHrToMetersPerSecond(float kmPerHr) |
static double |
distance(Location l1,
Location l2)
Returns the distance between two locations.
|
static double |
distance(Location loc,
Vector vector)
Determines the distance between a location and a vector.
|
static java.lang.String |
distanceFormat(double arg)
For formatting distances in meters to consistent 2 decimal places.
|
static double |
distanceHaversine(Location l1,
Location l2)
Returns the distance between two locations.
|
static double |
distanceIfMatch(Location loc,
Vector vector)
Same as distance() but returns NaN if the location is not along the vector.
|
static java.lang.String |
format(double arg)
For formatting latitudes and longitudes to consistent 5 decimal places
|
static java.lang.String |
headingFormat(float arg)
Outputs heading in degrees with just a single digit past the
decimal point.
|
static boolean |
headingOK(float vehicleHeading,
float segmentheading,
float allowableDelta)
Returns true if the heading specified by vehicleHeading is
within the allowableDelta of segmentHeading.
|
static void |
main(java.lang.String[] args)
Just for debugging
|
static double |
matchDistanceAlongVector(Location loc,
Vector vector)
Determines best match of location to the vector.
|
static Location |
offset(Location l,
double deltaX,
double deltaY)
Returns the Location l offset by deltaX and deltaY.
|
static java.lang.String |
oneDigitFormat(double value)
Outputs arg with just a single digit.
|
static Location |
rightOffsetBeginningLoc(Location l1,
Location l2,
double distance)
For determining an offset path that is the distance away from the
original path.
|
static Location |
rightOffsetEndLoc(Location l1,
Location l2,
double distance)
Just like rightOffsetBeginningLoc() except offsets l2 instead of l1.
|
static Location |
rightOffsetVertex(Location l1,
Location vertex,
Location l2,
double distance)
For shifting a path to the right.
|
static java.lang.String |
speedFormat(float arg)
Outputs speed in m/s with just a single digit past the
decimal point.
|
public static final float KPH_TO_MPS
public static final float MPH_TO_MPS
public static final float MPS_TO_MPH
public static final double RADIUS_OF_EARTH_IN_METERS
public static java.lang.String format(double arg)
public static java.lang.String distanceFormat(double arg)
arg
- public static java.lang.String oneDigitFormat(double value)
value
- public static java.lang.String headingFormat(float arg)
arg
- public static java.lang.String speedFormat(float arg)
arg
- public static float converKmPerHrToMetersPerSecond(float kmPerHr)
public static double distanceHaversine(Location l1, Location l2)
l1
- l2
- public static double distance(Location l1, Location l2)
l1
- l2
- public static Location offset(Location l, double deltaX, double deltaY)
l
- deltaX
- deltaY
- public static double distance(Location loc, Vector vector)
vector
- loc
- public static double distanceIfMatch(Location loc, Vector vector)
loc
- vector
- public static double matchDistanceAlongVector(Location loc, Vector vector)
loc
- vector
- public static Location rightOffsetVertex(Location l1, Location vertex, Location l2, double distance)
l1
- vertex
- l2
- distance
- to offset location l1 to the right. If negative then
offset to the left.public static Location rightOffsetBeginningLoc(Location l1, Location l2, double distance)
l1
- for specifying vectorl2
- for specifying vectordistance
- to offset location l1 to the right. If negative then
offset to the left.public static Location rightOffsetEndLoc(Location l1, Location l2, double distance)
l1
- for specifying vectorl2
- for specifying vectordistance
- to offset location l1 to the right. If negative then
offset to the left.public static void main(java.lang.String[] args)
args
- public static boolean headingOK(float vehicleHeading, float segmentheading, float allowableDelta)
vehicleHeading
- Heading of vehicle. If Float.NaN then
method will return truesegmentheading
- allowableDelta
-