protected double[] rhumbProjectDouble(Point2D from,Point2D to,boolean include_last,int nsegs){
  if (nsegs < 1) {
    nsegs=DrawUtil.pixel_distance((int)from.getX(),(int)from.getY(),(int)to.getX(),(int)to.getY()) >> 3;
    if (nsegs == 0)     nsegs=1;
 else     if (nsegs > MAX_RHUMB_SEGS)     nsegs=MAX_RHUMB_SEGS;
  }
  LatLonPoint llp=new LatLonPoint.Double();
  int[] xypts=DrawUtil.lineSegments((int)from.getX(),(int)from.getY(),(int)to.getX(),(int)to.getY(),nsegs,include_last,new int[nsegs << 1]);
  double[] llpts=new double[xypts.length];
  for (int i=0; i < llpts.length; i+=2) {
    inverse(xypts[i],xypts[i + 1],llp);
    llpts[i]=llp.getRadLat();
    llpts[i + 1]=llp.getRadLon();
  }
  return llpts;
}

protected double [ ] rhumbProjectDouble ( Point2D from , Point2D to , boolean include_last , int nsegs ) { if ( nsegs < 1 ) { nsegs = DrawUtil . pixel_distance ( ( int ) from . getX ( ) , ( int ) from . getY ( ) , ( int ) to . getX ( ) , ( int ) to . getY ( ) ) > > 3 ; if ( nsegs == 0 ) nsegs = 1 ; else if ( nsegs > MAX_RHUMB_SEGS ) nsegs = MAX_RHUMB_SEGS ; } LatLonPoint llp = new LatLonPoint . Double ( ) ; int [ ] xypts = DrawUtil . lineSegments ( ( int ) from . getX ( ) , ( int ) from . getY ( ) , ( int ) to . getX ( ) , ( int ) to . getY ( ) , nsegs , include_last , new int [ nsegs << 1 ] ) ; double [ ] llpts = new double [ xypts . length ] ; for ( int i = 0 ; i < llpts . length ; i += 2 ) { inverse ( xypts [ i ] , xypts [ i + 1 ] , llp ) ; llpts [ i ] = llp . getRadLat ( ) ; llpts [ i + 1 ] = llp . getRadLon ( ) ; } return llpts ; }
calculates the points along a rhumbline between two xy points . < p > loxodromes are straight in the mercator projection . calculate a bunch of extra points between the two points , inverse project back into latlons and return all the vertices .
