javafx - How to draw a line using the equation: y=mx + c in java -



javafx - How to draw a line using the equation: y=mx + c in java -

this question has reply here:

how draw line using y = mx +b in java? 3 answers

i draw line using equation of line gives slope/gradient , y intercept "c" i've tried draw line using 2 points using

public void paint(graphics g) { g.drawline(x1,y1,x2,y2); }

but draw line using equation instead.

any help appreciated.

just assume values of x - xa , xb. plug equation calculate y them, e.g.

g.drawline(xa, m*xa + c, xb, m*xb + c)

java javafx jframe line

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -