public static GeneralPath cardinalSpline(float pts[],float slack,boolean closed){
  GeneralPath path=new GeneralPath();
  path.moveTo(pts[0],pts[1]);
  return cardinalSpline(path,pts,slack,closed,0f,0f);
}

public static GeneralPath cardinalSpline ( float pts [ ] , float slack , boolean closed ) { GeneralPath path = new GeneralPath ( ) ; path . moveTo ( pts [ 0 ] , pts [ 1 ] ) ; return cardinalSpline ( path , pts , slack , closed , 0f , 0f ) ; }
compute a cardinal spline , a series of cubic bezier splines smoothly connecting a set of points . cardinal splines maintain c ( 1 ) continuity , ensuring the connected spline segments form a differentiable curve , ensuring at least a minimum level of smoothness .
