public float distanceSquared(Vector3f point) {
        TempVars vars = TempVars.get();

        Vector3f compVec1 = vars.vect1;
        Vector3f compVec2 = vars.vect2;

        point.subtract(origin, compVec1);
        float lineParameter = direction.dot(compVec1);
        origin.add(direction.mult(lineParameter, compVec2), compVec2);
        compVec2.subtract(point, compVec1);
        float len = compVec1.lengthSquared();
        vars.release();
        return len;
    }
Calculate the squared distance from this line to the specified point.

@param point location vector of the input point (not null, unaffected)
@return the square of the minimum distance (&ge;0)
jme3-core/src/main/java/com/jme3/math/Line.java