|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectPolynom
public class Polynom
The coefficients of a polynomial equation. The equation must be in the form
y = c0 +
c1×x +
c2×x2 +
c3×x3 + ... +
cn×xn.
The static method roots(double[]) can be used for computing the root of a polynomial
equation without creating a Polynom object.
| utility/geotk-utility (download) | View source code for this class |
| Constructor Summary | |
|---|---|
Polynom(double[] c)
Constructs a polynomial equation with the specified coefficients. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object object)
Compares this polynom with the specified object for equality. |
int |
hashCode()
Returns a hash value for this polynom. |
double[] |
roots()
Finds the roots of the polynomial equation. |
static double[] |
roots(double[] c)
Finds the roots of a polynomial equation. |
String |
toString()
Returns a string representation of this polynom. |
double |
y(double x)
Evaluates the polynomial equation for the specified x value. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Polynom(double[] c)
c - The coefficients. This array is copied.| Method Detail |
|---|
public final double y(double x)
c0 +
c1×x +
c2×x2 +
c3×x3 + ... +
cn×xn.
x - The value where to evaluate the polynomial equation.
public double[] roots()
public static double[] roots(double[] c)
c[0] +
c[1]*x +
c[2]*x2 +
c[3]*x3 +
... +
c[n]*xn == 0
where n is the array length minus 1.
c - The coefficients for the polynomial equation.
n-1.
UnsupportedOperationException - if there is more coefficients than this method
can handle.public int hashCode()
hashCode in class Objectpublic boolean equals(Object object)
equals in class Objectobject - The object to compare with this polynom.
true if both objects are equal.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||