Class PolynomialFunction
java.lang.Object
org.scictrl.mp.orbitcorrect.accessories.PolynomialFunction
- All Implemented Interfaces:
Cloneable
Class PolynomialFunction represents polynomial function.It gives methods to create polynomial function and to calculate
its values.
- Author:
- igor@scictrl.com
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPolynomialFunction default constructor that sets default values to coefitients polynomial functions X and Y.PolynomialFunction
(double[] x, double[] y) PolynomialFunction constructor that sets two input vectors of doubles to coefitients of polynomial functions X and Y. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones PolynomialFunction and returns it as Object.toString()
Returns string of name and coefitients of poynomial functions X and Y.double
X
(double y) Returns the value of polynomial function Y at point y.double
Y
(double x) Returns the value of polynomial function X at point x.
-
Field Details
-
coefX
public double[] coefXCoefitients of polynomial function X. -
coefY
public double[] coefYCoefitients of polynomial function Y.
-
-
Constructor Details
-
PolynomialFunction
public PolynomialFunction()PolynomialFunction default constructor that sets default values to coefitients polynomial functions X and Y. -
PolynomialFunction
PolynomialFunction constructor that sets two input vectors of doubles to coefitients of polynomial functions X and Y. They must be same size.- Parameters:
x
- an array ofinvalid reference
double
y
- an array ofinvalid reference
double
- Throws:
IllegalArgumentException
- if any.
-
-
Method Details
-
clone
Clones PolynomialFunction and returns it as Object. -
toString
Returns string of name and coefitients of poynomial functions X and Y. -
X
public double X(double y) Returns the value of polynomial function Y at point y.- Parameters:
y
- a double argument of polynomial function Y- Returns:
- a double
-
Y
public double Y(double x) Returns the value of polynomial function X at point x.- Parameters:
x
- a double argument of polynomial function Y- Returns:
- a double
-