protected static ArrayList<Position> generateReferenceLocations(
      Sector sector, int numLats, int numLons) {
    ArrayList<Position> locations = new ArrayList<Position>();
    double dLat =
        (sector.getMaxLatitude().degrees - sector.getMinLatitude().degrees) / (numLats - 1);
    double dLon =
        (sector.getMaxLongitude().degrees - sector.getMinLongitude().degrees) / (numLons - 1);
    for (int j = 0; j < numLats; j++) {
      double lat = sector.getMinLatitude().degrees + j * dLat;

      for (int i = 0; i < numLons; i++) {
        double lon = sector.getMinLongitude().degrees + i * dLon;

        // Specify angles to five decimal places.
        locations.add(
            Position.fromDegrees(
                Math.round(lat * 100000.0) / 100000.0, Math.round(lon * 100000.0) / 100000.0, 0));
      }
    }

    return locations;
  }