Modifier and Type | Class and Description |
---|---|
static class |
Position.LongitudePair |
Constructor and Description |
---|
Position(double lat,
double lon) |
Position(double lat,
double lon,
double alt) |
Modifier and Type | Method and Description |
---|---|
static void |
assertWithMsg(boolean assertion,
String msg) |
static Position |
create(double lat,
double lon) |
static Position |
create(double lat,
double lon,
double alt) |
Position |
ensureContinuous(Position lastPosition)
normalize the lat lon values of this to ensure that no large longitude
jumps are made from lastPosition (e.g.
|
boolean |
equals(Object o) |
double |
getAlt() |
double |
getBearingDegrees(Position position)
Returns a great circle bearing in degrees in the range 0 to 360.
|
static double |
getBearingDifferenceDegrees(double bearing1,
double bearing2)
returns difference in degrees in the range -180 to 180
|
Position |
getClosestIntersectionWithSegment(Position p1,
Position p2) |
double |
getDistanceKmToPath(Position p1,
Position p2)
calculates the distance of a point to the great circle path between p1
and p2.
|
double |
getDistanceToKm(Position position)
returns distance between two WGS84 positions according to Vincenty's
formula from Wikipedia
|
double |
getDistanceToPathKm(List<Position> positions) |
double |
getDistanceToSegmentKm(Position p1,
Position p2) |
Position[] |
getEarthLimb(int radials)
Return an array of Positions representing the earths limb (aka: horizon)
as viewed from this Position in space.
|
double |
getLat() |
Double |
getLatitudeOnGreatCircle(Position position,
double longitudeDegrees)
From http://williams.best.vwh.net/avform.htm (Latitude of point on GC).
|
double |
getLon() |
Position.LongitudePair |
getLongitudeOnGreatCircle(Position position,
double latitudeDegrees)
Returns null if no crossing of latitude otherwise return two longitude
candidates.
|
Position |
getPositionAlongPath(Position position,
double proportion)
Returns a position along a path according to the proportion value
|
List<Position> |
getPositionsAlongPath(Position position,
double maxSegmentLengthKm) |
int |
hashCode() |
boolean |
isOutside(List<Position> path,
double minDistanceKm) |
boolean |
isWithin(List<Position> positions) |
static double |
longitudeDiff(double a,
double b)
Returns the difference between two longitude values.
|
Position |
normalizeLongitude() |
Position |
predict(double distanceKm,
double courseDegrees)
Predicts position travelling along a great circle arc based on the
Haversine formula.
|
static double |
to180(double d)
Converts an angle in degrees to range -180< x <= 180.
|
Position |
to360() |
static double |
toDegrees(double degrees,
double minutes,
double seconds) |
static String |
toDegreesMinutesDecimalMinutesLatitude(double lat) |
static String |
toDegreesMinutesDecimalMinutesLongitude(double lon) |
String |
toString() |
public Position(double lat, double lon)
lat
- in degreeslon
- in degreespublic Position(double lat, double lon, double alt)
lat
- in degreeslon
- in degreesalt
- in metrespublic static Position create(double lat, double lon)
public static Position create(double lat, double lon, double alt)
public final double getLat()
public final double getLon()
public final double getAlt()
public final Position predict(double distanceKm, double courseDegrees)
distanceKm
- courseDegrees
- public static double toDegrees(double degrees, double minutes, double seconds)
public Double getLatitudeOnGreatCircle(Position position, double longitudeDegrees)
position
- longitudeDegrees
- public Position.LongitudePair getLongitudeOnGreatCircle(Position position, double latitudeDegrees)
position
- latitudeDegrees
- public final Position[] getEarthLimb(int radials)
radials
- the number of radials to calculated (evenly spaced around the
circumference of the circlepublic final double getDistanceToKm(Position position)
position
- public final double getBearingDegrees(Position position)
position
- public static double getBearingDifferenceDegrees(double bearing1, double bearing2)
bearing1
- degrees between -360 and 360bearing2
- degrees between -360 and 360public final double getDistanceKmToPath(Position p1, Position p2)
p1
- p2
- public static String toDegreesMinutesDecimalMinutesLatitude(double lat)
public static String toDegreesMinutesDecimalMinutesLongitude(double lon)
public static void assertWithMsg(boolean assertion, String msg)
public final Position getPositionAlongPath(Position position, double proportion)
position
- proportion
- is between 0 and 1 inclusivepublic final List<Position> getPositionsAlongPath(Position position, double maxSegmentLengthKm)
public final Position to360()
public final Position ensureContinuous(Position lastPosition)
lastPosition
- public final Position getClosestIntersectionWithSegment(Position p1, Position p2)
public boolean isOutside(List<Position> path, double minDistanceKm)
path
- minDistanceKm
- public static double longitudeDiff(double a, double b)
a
- b
- public static double to180(double d)
d
- public Position normalizeLongitude()
Copyright © 2020. All rights reserved.