private void addFillet(Coordinate p,Coordinate p0,Coordinate p1,int direction,double radius){
  double dx0=p0.x - p.x;
  double dy0=p0.y - p.y;
  double startAngle=Math.atan2(dy0,dx0);
  double dx1=p1.x - p.x;
  double dy1=p1.y - p.y;
  double endAngle=Math.atan2(dy1,dx1);
  if (direction == CGAlgorithms.CLOCKWISE) {
    if (startAngle <= endAngle)     startAngle+=2.0 * Math.PI;
  }
 else {
    if (startAngle >= endAngle)     startAngle-=2.0 * Math.PI;
  }
  segList.addPt(p0);
  addFillet(p,startAngle,endAngle,direction,radius);
  segList.addPt(p1);
}

private void addFillet ( Coordinate p , Coordinate p0 , Coordinate p1 , int direction , double radius ) { double dx0 = p0 . x - p . x ; double dy0 = p0 . y - p . y ; double startAngle = Math . atan2 ( dy0 , dx0 ) ; double dx1 = p1 . x - p . x ; double dy1 = p1 . y - p . y ; double endAngle = Math . atan2 ( dy1 , dx1 ) ; if ( direction == CGAlgorithms . CLOCKWISE ) { if ( startAngle <= endAngle ) startAngle += 2.0 * Math . PI ; } else { if ( startAngle >= endAngle ) startAngle -= 2.0 * Math . PI ; } segList . addPt ( p0 ) ; addFillet ( p , startAngle , endAngle , direction , radius ) ; segList . addPt ( p1 ) ; }
add points for a circular fillet around a reflex corner . adds the start and end points
