public final double radian(Coords d){
  final IdealHex src=IdealHex.get(this);
  final IdealHex dst=IdealHex.get(d);
  if (src.cy == dst.cy) {
    return (src.cx < dst.cx) ? Math.PI / 2 : Math.PI * 1.5;
  }
  double r=Math.atan((dst.cx - src.cx) / (src.cy - dst.cy));
  if (src.cy < dst.cy) {
    r=(r + Math.PI) % (Math.PI * 2);
  }
  if (r < 0) {
    r+=Math.PI * 2;
  }
  return r;
}

public final double radian ( Coords d ) { final IdealHex src = IdealHex . get ( this ) ; final IdealHex dst = IdealHex . get ( d ) ; if ( src . cy == dst . cy ) { return ( src . cx < dst . cx ) ? Math . PI / 2 : Math . PI * 1.5 ; } double r = Math . atan ( ( dst . cx - src . cx ) / ( src . cy - dst . cy ) ) ; if ( src . cy < dst . cy ) { r = ( r + Math . PI ) % ( Math . PI * 2 ) ; } if ( r < 0 ) { r += Math . PI * 2 ; } return r ; }
returns the radian direction of another coords .
