jphase
Class Poly

java.lang.Object
  extended by jphase.Poly

public class Poly
extends java.lang.Object

This class represents a polynomial.

Author:
German Riano. Universidad de los Andes. (C) 2006

Constructor Summary
Poly()
          ` * Creates a Polynomial = 0.0.
Poly(double[] cf)
          Build a Plynomial with these coefficients
 
Method Summary
 Poly addTerm(double coeff, int n)
          Adds this term: cf * t^n
 double evaluate(double x)
          Returns the value of this polynomial at x.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Poly

public Poly(double[] cf)
Build a Plynomial with these coefficients

Parameters:
cf - Coefficients

Poly

public Poly()
` * Creates a Polynomial = 0.0.

Method Detail

addTerm

public Poly addTerm(double coeff,
                    int n)
Adds this term: cf * t^n

Parameters:
coeff - Coefficient of the term to be added
n - Exponent of the term to be added
Returns:
Modified Poynomial

evaluate

public double evaluate(double x)
Returns the value of this polynomial at x.

Parameters:
x - evaluation point
Returns:
Value of this polynomial at x.