public void paintCircle(Point2D pt1,Point2D pt2,Graphics graphics){
  if (displayCircle && theMap != null) {
    Graphics2D g=(Graphics2D)graphics;
    if (pt1 != null && pt2 != null) {
      double radphi1=ProjMath.degToRad(pt1.getY());
      double radlambda0=ProjMath.degToRad(pt1.getX());
      double radphi=ProjMath.degToRad(pt2.getY());
      double radlambda=ProjMath.degToRad(pt2.getX());
      double dRad=GreatCircle.sphericalDistance(radphi1,radlambda0,radphi,radlambda);
      double rad=ProjMath.radToDeg(dRad);
      OMCircle circle=new OMCircle(pt1.getY(),pt1.getX(),rad);
      renderAttributes.setTo(circle);
      Projection proj=theMap.getRotatedProjection();
      circle.generate(proj);
      circle.render(g);
    }
  }
}

public void paintCircle ( Point2D pt1 , Point2D pt2 , Graphics graphics ) { if ( displayCircle && theMap != null ) { Graphics2D g = ( Graphics2D ) graphics ; if ( pt1 != null && pt2 != null ) { double radphi1 = ProjMath . degToRad ( pt1 . getY ( ) ) ; double radlambda0 = ProjMath . degToRad ( pt1 . getX ( ) ) ; double radphi = ProjMath . degToRad ( pt2 . getY ( ) ) ; double radlambda = ProjMath . degToRad ( pt2 . getX ( ) ) ; double dRad = GreatCircle . sphericalDistance ( radphi1 , radlambda0 , radphi , radlambda ) ; double rad = ProjMath . radToDeg ( dRad ) ; OMCircle circle = new OMCircle ( pt1 . getY ( ) , pt1 . getX ( ) , rad ) ; renderAttributes . setTo ( circle ) ; Projection proj = theMap . getRotatedProjection ( ) ; circle . generate ( proj ) ; circle . render ( g ) ; } } }
draw a rubberband circle between two points
