public class Quadratic
extends java.lang.Object
a*x^2 + b*x + c = 0See 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 and Description |
---|
Quadratic(double a,
double b,
double c) |
Modifier and Type | Method and Description |
---|---|
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() |
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.Object
public java.lang.String test()
public static void main(java.lang.String[] args)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details