I want to give a small hint for those who want to program mathematical graphics in Java.
In Java the coordinate system is different from the "real" math coordinate system.
Here how looks like the Java coordinate system:
As you can see, the Y increases in the direction from top to bottom.
If you want to draw a line like 2*y - 3*x = 5 then, you can't work with the Java coordinates.
The fix is easy, we change the sign of the Java coordinates, for the Y value. So, of point B was at (100,150) in Java, then, the real coordinate will be (100,-150).
It's easy, no?