Interface ILatLng

All Superinterfaces:
java.io.Serializable

public interface ILatLng
extends java.io.Serializable
The latitude and longitude of a location on Earth.
Author:
swong
  • Method Summary

    Modifier and Type Method Description
    static double degreesToRadians​(double degrees)
    Convert the given value from degrees to radians
    double distanceBetween​(ILatLng otherLatLng, double earthRadius)
    The distance between this and a given ILatLng, assuming a spherical Earth
    double getLat()
    Accessor for the latitude
    double getLng()
    Accessor for the longitude
    static ILatLng make​(double lat, double lng)
    Make a new ILatLng object
  • Method Details

    • getLat

      double getLat()
      Accessor for the latitude
      Returns:
      The latitude value
    • getLng

      double getLng()
      Accessor for the longitude
      Returns:
      The longitude value
    • distanceBetween

      double distanceBetween​(ILatLng otherLatLng, double earthRadius)
      The distance between this and a given ILatLng, assuming a spherical Earth
      Parameters:
      otherLatLng - The other ILatLng location
      earthRadius - The Earth's radius to use in any units
      Returns:
      The distance between the two locations in the same units as the given Earth's radius.
    • degreesToRadians

      static double degreesToRadians​(double degrees)
      Convert the given value from degrees to radians
      Parameters:
      degrees - A value in degrees
      Returns:
      The equivalent value in radians.
    • make

      static ILatLng make​(double lat, double lng)
      Make a new ILatLng object
      Parameters:
      lat - Latitude value in the range [-90, +90]
      lng - Longitude value in the range [-180, +180]
      Returns:
      An instance of ILatLng