cdm/src/main/java/ucar/unidata/geoloc/projection/RotatedLatLon.java
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint) {
    /*
    Tor's algorithm
    public double[] fwd(double[] lonlat)
      return transform(lonlat, lonpole, polerotate, sinDlat);
    */
    double[] lonlat = new double[2];
    lonlat[0] = latlon.getLongitude();
    lonlat[1] = latlon.getLatitude();

    double[] rlonlat = rotate(lonlat, lonpole, polerotate, sinDlat);
    if (destPoint == null)
      destPoint = new ProjectionPointImpl(rlonlat[0], rlonlat[1]);
    else
      destPoint.setLocation(rlonlat[0], rlonlat[1]);

    if (show)
      System.out.println("LatLon= " + latlon + " proj= " + destPoint);

    return destPoint;
  }
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint) {
    /*
    Tor's algorithm
    public double[] fwd(double[] lonlat)
      return transform(lonlat, lonpole, polerotate, sinDlat);
    */
    double[] lonlat = new double[2];
    lonlat[0] = latlon.getLongitude();
    lonlat[1] = latlon.getLatitude();

    double[] rlonlat = rotate(lonlat, lonpole, polerotate, sinDlat);
    if (destPoint == null)
      destPoint = new ProjectionPointImpl(rlonlat[0], rlonlat[1]);
    else
      destPoint.setLocation(rlonlat[0], rlonlat[1]);

    if (show)
      System.out.println("LatLon= " + latlon + " proj= " + destPoint);

    return destPoint;
  }
public ProjectionPoint latLonToProj ( LatLonPoint latlon , ProjectionPointImpl destPoint ) { /*
    Tor's algorithm
    public double[] fwd(double[] lonlat)
      return transform(lonlat, lonpole, polerotate, sinDlat);
    */ double [ ] lonlat = new double [ 2 ] ; lonlat [ 0 ] = latlon . getLongitude ( ) ; lonlat [ 1 ] = latlon . getLatitude ( ) ; double [ ] rlonlat = rotate ( lonlat , lonpole , polerotate , sinDlat ) ; if ( destPoint == null ) destPoint = new ProjectionPointImpl ( rlonlat [ 0 ] , rlonlat [ 1 ] ) ; else destPoint . setLocation ( rlonlat [ 0 ] , rlonlat [ 1 ] ) ; if ( show ) System . out . println ( "LatLon= " + latlon + " proj= " + destPoint ) ; return destPoint ; }
Transform a "real" longitude and latitude into the rotated longitude (X) and
rotated latitude (Y).
Transform a real longitude and latitude into the rotated longitude ( X ) and rotated latitude ( Y ) .