So I have a program that solves a system of linear equations, but that is not relevant. So what happens is that my program pass two linear equations in the form of: y = mx +b. I do not know how I would graph this using Graphics2D, I am having some trouble figuring it out. Right now I have no idea so I have no code that I could show you, but I can tell you that:
- That my program correctly converts Ax + By = C into y = mx + B
- That it would be helpful to show an example in some code possibly using the drawLine() method
When you draw a line in code, you need to draw from point
Ato pointB. (a line segment)Pick a point
Ato start the line from, then draw fromAto(A.X + dx, A.Y + m * dx), wheredxis the desired width of the line.For example, you may want
Ato be one corner of your area, anddxto be the width of the area.