Class GreatCirclePointDistance


  • public class GreatCirclePointDistance
    extends java.lang.Object
    Determines final Latitude and Longitude based on a bearing.
    Constant values are calculated once to avoid repetition.
    Latitude and longitude calculated in stages to avoid unnecessary calculations.
    • Constructor Detail

      • GreatCirclePointDistance

        public GreatCirclePointDistance​(double startLat,
                                        double startLon,
                                        double distance)
    • Method Detail

      • getDistance

        public double getDistance()
      • getAngDistance

        public double getAngDistance()
      • getStartLat

        public double getStartLat()
      • getStartLon

        public double getStartLon()
      • getLatRad

        public double getLatRad()
      • getLonRad

        public double getLonRad()
      • getSinStartLat

        public double getSinStartLat()
      • getCosStartLat

        public double getCosStartLat()
      • getSinAngDistance

        public double getSinAngDistance()
      • getCosAngDistance

        public double getCosAngDistance()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • latitude

        public double latitude​(double bearingRad)
      • longitude

        public double longitude​(double endLatRad,
                                double bearingRad)
      • radToPoint

        public static final LatLonPoint radToPoint​(double latRad,
                                                   double lonRad)
        Convert Lat/Lon in radians to Point in degrees.
        Longitude normalised between -180 and 180.
        Parameters:
        latRad -
        lonRad -
        Returns:
        Lat/Lon Point in degrees.
      • radToPoint

        public static final LatLonPoint radToPoint​(double latRad,
                                                   double lonRad,
                                                   boolean isNormaliseLon)
        Convert Lat/Lon in radians to Point in degrees.
        Parameters:
        latRad -
        lonRad -
        isNormaliseLon - Normalise Longitude between -180 and 180.
        Returns:
        Lat/Lon Point in degrees.
      • normaliseLongitude

        public static double normaliseLongitude​(double lonDegrees)
        Normalise Longitude in degrees to the range -180 to 180.
        Parameters:
        lonDegrees -
        Returns:
        Lat/Lon Point in degrees.
      • getPoint

        public static final LatLonPoint getPoint​(LatLonPoint startPoint,
                                                 double distance,
                                                 double bearing)
        Lat/Lon Point from start Lat/Lon Point following bearing degrees (clockwise from north) and distance (metres).
        Parameters:
        startPoint -
        distance -
        bearing -
        Returns:
        Lat/Lon point in the distance and bearing from start point.
      • getPoint

        public static final LatLonPoint getPoint​(double startLat,
                                                 double startLon,
                                                 double distance,
                                                 double bearing)
        Lat/Lon Point from start Lat/x,Lon/y following bearing degrees (clockwise from north) and distance (metres).
        Parameters:
        startLat -
        startLon -
        distance -
        bearing -
        Returns:
        Lat/Lon point in the distance and bearing from start point.