public static void growPolygon(float pts[],int len,float amt){
  float[] c=centroid(pts,len);
  for (int i=0; i < len; i+=2) {
    float vx=pts[i] - c[0];
    float vy=pts[i + 1] - c[1];
    float norm=(float)Math.sqrt(vx * vx + vy * vy);
    pts[i]+=amt * vx / norm;
    pts[i + 1]+=amt * vy / norm;
  }
}

public static void growPolygon ( float pts [ ] , int len , float amt ) { float [ ] c = centroid ( pts , len ) ; for ( int i = 0 ; i < len ; i += 2 ) { float vx = pts [ i ] - c [ 0 ] ; float vy = pts [ i + 1 ] - c [ 1 ] ; float norm = ( float ) Math . sqrt ( vx * vx + vy * vy ) ; pts [ i ] += amt * vx / norm ; pts [ i + 1 ] += amt * vy / norm ; } }
expand a polygon by adding the given distance along the line from the centroid of the polyong .
