public static LatLon[] greatCircleExtremeLocations(LatLon location,Angle azimuth){
  if (location == null) {
    throw new IllegalArgumentException("Location Is Null");
  }
  if (azimuth == null) {
    throw new IllegalArgumentException("Azimuth Is Null");
  }
  double lat0=location.getLatitude().radians;
  double az=azimuth.radians;
  double tanDistance=-Math.tan(lat0) / Math.cos(az);
  double distance=Math.atan(tanDistance);
  Angle extremeDistance1=Angle.fromRadians(distance + (Math.PI / 2.0));
  Angle extremeDistance2=Angle.fromRadians(distance - (Math.PI / 2.0));
  return new LatLon[]{greatCircleEndPosition(location,azimuth,extremeDistance1),greatCircleEndPosition(location,azimuth,extremeDistance2)};
}

public static LatLon [ ] greatCircleExtremeLocations ( LatLon location , Angle azimuth ) { if ( location == null ) { throw new IllegalArgumentException ( "Location Is Null" ) ; } if ( azimuth == null ) { throw new IllegalArgumentException ( "Azimuth Is Null" ) ; } double lat0 = location . getLatitude ( ) . radians ; double az = azimuth . radians ; double tanDistance = - Math . tan ( lat0 ) / Math . cos ( az ) ; double distance = Math . atan ( tanDistance ) ; Angle extremeDistance1 = Angle . fromRadians ( distance + ( Math . PI / 2.0 ) ) ; Angle extremeDistance2 = Angle . fromRadians ( distance - ( Math . PI / 2.0 ) ) ; return new LatLon [ ] { greatCircleEndPosition ( location , azimuth , extremeDistance1 ) , greatCircleEndPosition ( location , azimuth , extremeDistance2 ) } ; }
returns two locations with the most extreme latitudes on the great circle with the given starting location and azimuth .
