src/main/java/de/javagl/geom/Lines.java
/**
     * Returns the squared length of the given line
     * 
     * @param line The line
     * @return The squared length
     */
Returns the squared length of the given line

@param line The line
@return The squared length
Returns the squared length of the given line @param line The line @return The squared length
public static double lengthSquared(Line2D line)
    {
        double x0 = line.getX1();
        double y0 = line.getY1();
        double x1 = line.getX2();
        double y1 = line.getY2();
        double dx = x1-x0;
        double dy = y1-y0;
        return dx * dx + dy * dy;
    }
public static double lengthSquared ( Line2D line ) { double x0 = line . getX1 ( ) ; double y0 = line . getY1 ( ) ; double x1 = line . getX2 ( ) ; double y1 = line . getY2 ( ) ; double dx = x1 - x0 ; double dy = y1 - y0 ; return dx * dx + dy * dy ; }
Returns the squared length of the given line
Returns the squared length of the given line