Package geo

Class Bounds


  • public class Bounds
    extends Object
    Methods for computing the latitudes and longitudes spanned by a set of points.

    PS1 instructions: do NOT change the method signatures or specifications of these methods, but you should implement their method bodies, and you may add new public or private methods or classes if you like.

    • Method Detail

      • latitudeRange

        public static List<Angle> latitudeRange​(Set<PointOfInterest> pointsOfInterest)
        Find minimum-area latitude range that encloses all points of interest.
        Parameters:
        pointsOfInterest - set of POIs, not modified by this method
        Returns:
        a new two-element list representing a minimum-area band of latitudes such that sweeping a latitude line from latitude list[0] NORTHWARD to latitude list[1] touches every point in pointsOfInterest
      • longitudeRange

        public static List<Angle> longitudeRange​(Set<PointOfInterest> pointsOfInterest)
        Find minimum-area longitude range that encloses all points of interest.
        Parameters:
        pointsOfInterest - set of POIs, not modified by this method
        Returns:
        a new two-element list representing a minimum-area band of longitudes (also called a spherical lune) such that sweeping a longitude line from longitude list[0] EASTWARD to longitude list[1] touches every point in pointsOfInterest