public static void drawLine(int x0, int y0, int x1, int y1, PlotOperator plot)
    {
        if (x0 > x1)
        {
            drawLine(x1, y1, x0, y0, plot);
        }
        else
        {
            if (y0 > y1)
            {
                drawLine(x0, -y0, x1, -y1, (x, y) -> plot.plot(x, -y));
            }
            else
            {
                drawLine1(x0, y0, x1, y1, plot);    // ok to go ahead
            }
        }
    }
public static void drawLine ( int x0 , int y0 , int x1 , int y1 , PlotOperator plot ) { if ( x0 > x1 ) { drawLine ( x1 , y1 , x0 , y0 , plot ) ; } else { if ( y0 > y1 ) { drawLine ( x0 , - y0 , x1 , - y1 , ( x , y ) -> plot . plot ( x , - y ) ) ; } else { drawLine1 ( x0 , y0 , x1 , y1 , plot ) ; } } }
Draws line ((x0, y0), (x1, y1)) by plotting points using plot
@param x0
@param y0
@param x1
@param y1
@param plot
@param color