private void drawArrow(Graphics g,Point s,Point e){
  double aDir=MathUtil.atan2(e.getY() - s.getY(),e.getX() - s.getX());
  if (aDir < -Math.PI / 2) {
    aDir=MathUtil.atan2(s.getY() - e.getY(),s.getX() - e.getX());
    aDir-=Math.PI;
  }
  aDir-=Math.PI / 2;
  ArrowHead arrowHead=new ArrowHead(arrowHeight,arrowWidth);
  arrowHead.rotate(aDir);
  arrowHead.translate(s.getX() + ((e.getX() - s.getX()) / 2),s.getY() + ((e.getY() - s.getY()) / 2));
  arrowHead.paint(g);
}

private void drawArrow ( Graphics g , Point s , Point e ) { double aDir = MathUtil . atan2 ( e . getY ( ) - s . getY ( ) , e . getX ( ) - s . getX ( ) ) ; if ( aDir < - Math . PI / 2 ) { aDir = MathUtil . atan2 ( s . getY ( ) - e . getY ( ) , s . getX ( ) - e . getX ( ) ) ; aDir -= Math . PI ; } aDir -= Math . PI / 2 ; ArrowHead arrowHead = new ArrowHead ( arrowHeight , arrowWidth ) ; arrowHead . rotate ( aDir ) ; arrowHead . translate ( s . getX ( ) + ( ( e . getX ( ) - s . getX ( ) ) / 2 ) , s . getY ( ) + ( ( e . getY ( ) - s . getY ( ) ) / 2 ) ) ; arrowHead . paint ( g ) ; }
this method clones arrowhead object which represents arrow and translate it to position on the map .
