|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object LinearEquation
A LinearEquation models equations of the form y = mx + b.
Constructor Summary | |
LinearEquation(double m,
double b)
Construct a LinearEquation from a slope and y-intercept. |
|
LinearEquation(double x1,
double y1,
double x2,
double y2)
Construct a LinearEquation from two points. |
Method Summary | |
double |
compute(double x)
Compute y, given x. |
LinearEquation |
getInverse()
Compute the inverse of this linear equation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LinearEquation(double m, double b)
m
- the slope.b
- the y-intercept.public LinearEquation(double x1, double y1, double x2, double y2)
x1
- the x coordinate of the first pointy1
- the y coordinate of the first pointx2
- the x coordinate of the second pointy2
- the y coordinate of the second pointMethod Detail |
public double compute(double x)
x
- the input value.
public LinearEquation getInverse()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |