public float distanceSquared(float otherX, float otherY) {
        double dx = x - otherX;
        double dy = y - otherY;
        return (float) (dx * dx + dy * dy);
    }
Returns the square of the distance between the current instance and a
vector with the specified components. The current instance is unaffected.

@param otherX the X component of the vector to compare
@param otherY the Y component of the vector to compare
@return the square of the Euclidean distance (not negative)
jme3-core/src/main/java/com/jme3/math/Vector2f.java