|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.geo.Quadratic
public class Quadratic
Computes 0 to 2 real roots of the quadratic:
a*x^2 + b*x + c = 0
See http://web.cs.mun.ca/courses/cs2710-w02/lab5/assignment/assign5.html.
http://www.1728.com/quadratc.htm
Access the roots as a double iterator with methods hasNext() and next().
| Constructor Summary | |
|---|---|
Quadratic(double a,
double b,
double c)
|
|
| Method Summary | |
|---|---|
double |
eval(double x)
Evaluate the Quadratic at x. |
boolean |
hasNext()
|
static double |
linear(double a,
double b)
Returns the solution, x, to the equation a*x+b = 0 |
static void |
main(java.lang.String[] args)
|
double |
next()
|
void |
solve()
Solve a*x^2 + b*x + c = 0 for x for real values of x. |
java.lang.String |
test()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Quadratic(double a,
double b,
double c)
| Method Detail |
|---|
public static double linear(double a,
double b)
public void solve()
See Winston and Horn, LISP p. 167-169.
public double eval(double x)
public boolean hasNext()
public double next()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String test()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||