|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme3tools.navigation.NavCalculator
public class NavCalculator
A utlity class for performing position calculations
Nested Class Summary | |
---|---|
static class |
NavCalculator.Quadrant
|
Field Summary | |
---|---|
static int |
GC
|
static int |
MERCATOR
|
static int |
METERS_PER_MINUTE
|
static int |
RL_CRS_PRECISION
|
static int |
RL_DIST_PRECISION
|
static int |
WGS84_EARTH_RADIUS
|
Constructor Summary | |
---|---|
NavCalculator()
Constructor |
|
NavCalculator(Position P1,
Position P2,
int calcType)
Constructor |
Method Summary | |
---|---|
static int |
computeAngle(Position p1,
Position p2)
Computes the angle between two points. |
static int |
computeBearing(Position p1,
Position p2)
Computes the bearing between two points. |
static double |
computeDLat(double lat1,
double lat2)
Compute the difference in latitude between two positions |
static double |
computeDLong(double lng1,
double lng2)
Computes the difference in Longitude between two positions and assigns the correct sign -westwards travel, + eastwards travel |
static double |
computeDMPClarkeSpheroid(double lat1,
double lat2)
Computes the difference in meridional parts for two latitudes in minutes (based on Clark 1880 spheroid) |
static float |
computeDMPWGS84Spheroid(float lat1,
float lat2)
Computes the difference in meridional parts for a perfect sphere between two degrees of latitude |
static int |
computeHeading(Position p1,
Position p2)
|
static double |
computeLongDiff(double lng1,
double lng2)
Computes the difference in Longitude between two positions and assigns the correct sign -westwards travel, + eastwards travel |
static Position |
computePosition(Position initialPos,
double heading,
double distance)
Computes the coordinate of position B relative to an offset given a distance and an angle. |
static double |
convertCourse(float tc,
Position p1,
Position p2)
Converts a course from cardinal XddY to ddd notation |
double |
getDistance()
Getter method for the distance between two points |
java.lang.String |
getStrCourse()
Getter method for the true course |
double |
getTrueCourse()
Getter method for the true course |
GCSailing |
greatCircleSailing(Position p1,
Position p2)
Determines a great circle track between two positions |
static void |
main(java.lang.String[] args)
|
RLSailing |
mercatorSailing(Position p1,
Position p2)
Determines the rhumb line course and distance between two positions |
RLSailing |
planeSailing(Position p1,
Position p2)
Calculate a plane sailing situation - i.e. |
static Position |
predictPosition(int time,
double speed,
double currentLat,
double currentLong,
double course)
Predicts the position of a target for a given time in the future |
RLSailing |
rhumbLineSailing(Position p1,
Position p2)
Determines a Rhumb Line course and distance between two points |
static double |
toDegrees(double meters)
Converts meters to degrees. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WGS84_EARTH_RADIUS
public static final int MERCATOR
public static final int GC
public static final int RL_CRS_PRECISION
public static final int RL_DIST_PRECISION
public static final int METERS_PER_MINUTE
Constructor Detail |
---|
public NavCalculator(Position P1, Position P2, int calcType)
P1
- P2
- calcType
- public NavCalculator()
Method Detail |
---|
public GCSailing greatCircleSailing(Position p1, Position p2)
p1
- origin positionp2
- destination positionpublic RLSailing rhumbLineSailing(Position p1, Position p2)
p1
- origin positionp2
- destination positionpublic RLSailing mercatorSailing(Position p1, Position p2)
p1
- origin positionp2
- destination positionpublic RLSailing planeSailing(Position p1, Position p2)
p1
- p2
-
public static double convertCourse(float tc, Position p1, Position p2)
tc
- p1
- position onep2
- position two
public double getDistance()
public double getTrueCourse()
public java.lang.String getStrCourse()
public static double computeDMPClarkeSpheroid(double lat1, double lat2)
lat1
- lat2
-
public static float computeDMPWGS84Spheroid(float lat1, float lat2)
lat1
- lat2
-
public static Position predictPosition(int time, double speed, double currentLat, double currentLong, double course)
time
- the number of seconds from now for which to predict the future
positionspeed
- the miles per minute that the target is travelingcurrentLat
- the target's current latitudecurrentLong
- the target's current longitudecourse
- the target's current course in degrees
public static Position computePosition(Position initialPos, double heading, double distance)
offset
- The offset position.bearing
- The bearing between the offset and the coordinate
that you want to calculate.distance
- The distance, in meters, between the offset
and point B.
public static double computeDLong(double lng1, double lng2)
lng1
- lng2
-
public static double computeLongDiff(double lng1, double lng2)
lng1
- lng2
-
public static double computeDLat(double lat1, double lat2)
lat1
- lat2
-
public static double toDegrees(double meters)
meters
- The meters that you want to convert into degrees.
public static int computeBearing(Position p1, Position p2)
p1
- p2
-
public static int computeAngle(Position p1, Position p2)
p1
- p2
-
public static int computeHeading(Position p1, Position p2)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |