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 answersi 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
Post a Comment