Calculating y-intercept of a straight line
in
Programming Questions
•
1 year ago
Hi,
I need to calculate the y intercept of a straight line given 2 sets of coordinates and the gradient, although this obviously has to be done automatically... here is my current code:
- void getEquation(float gradient) {
- float intercept = ;
- String output = gradient + "x + " + intercept;
- println(output);
- }
1