public static float approximateLength(float controlPoints[][]){
  float length=0;
  for (int i=0; i < controlPoints.length - 1; i++) {
    float xDif=controlPoints[i + 1][0] - controlPoints[i][0];
    float yDif=controlPoints[i + 1][1] - controlPoints[i][1];
    float zDif=controlPoints[i + 1][2] - controlPoints[i][2];
    length+=Math.sqrt(xDif * xDif + yDif * yDif + zDif * zDif);
  }
  return length;
}

public static float approximateLength ( float controlPoints [ ] [ ] ) { float length = 0 ; for ( int i = 0 ; i < controlPoints . length - 1 ; i ++ ) { float xDif = controlPoints [ i + 1 ] [ 0 ] - controlPoints [ i ] [ 0 ] ; float yDif = controlPoints [ i + 1 ] [ 1 ] - controlPoints [ i ] [ 1 ] ; float zDif = controlPoints [ i + 1 ] [ 2 ] - controlPoints [ i ] [ 2 ] ; length += Math . sqrt ( xDif * xDif + yDif * yDif + zDif * zDif ) ; } return length ; }
compute an approximate length of a bezier curve given the control points .
