public static float getBezierP1toP2Length(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3) {
        float delta = 0.02f, t = 0.0f, result = 0.0f;
        Vector3f v1 = p0.clone(), v2 = new Vector3f();
        while (t <= 1.0f) {
            FastMath.interpolateBezier(t, p0, p1, p2, p3, v2);
            result += v1.subtractLocal(v2).length();
            v1.set(v2);
            t += delta;
        }
        return result;
    }
Compute the length on a Bezier spline between control points 1 and 2.

@param p0 control point 0
@param p1 control point 1
@param p2 control point 2
@param p3 control point 3
@return the length of the segment
jme3-core/src/main/java/com/jme3/math/FastMath.java