Class PolynomialFunction

java.lang.Object
org.scictrl.mp.orbitcorrect.accessories.PolynomialFunction
All Implemented Interfaces:
Cloneable

public class PolynomialFunction extends Object implements Cloneable
Class PolynomialFunction represents polynomial function.It gives methods to create polynomial function and to calculate its values.
Author:
igor@scictrl.com
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double[]
    Coefitients of polynomial function X.
    double[]
    Coefitients of polynomial function Y.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PolynomialFunction 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 Type
    Method
    Description
    Clones PolynomialFunction and returns it as Object.
    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.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • coefX

      public double[] coefX
      Coefitients of polynomial function X.
    • coefY

      public double[] coefY
      Coefitients of polynomial function Y.
  • Constructor Details

    • PolynomialFunction

      public PolynomialFunction()
      PolynomialFunction default constructor that sets default values to coefitients polynomial functions X and Y.
    • PolynomialFunction

      public PolynomialFunction(double[] x, double[] y) throws IllegalArgumentException
      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 of
      invalid reference
      double
      objects
      y - an array of
      invalid reference
      double
      objects
      Throws:
      IllegalArgumentException - if any.
  • Method Details

    • clone

      public Object clone()
      Clones PolynomialFunction and returns it as Object.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Returns string of name and coefitients of poynomial functions X and Y.
      Overrides:
      toString in class Object
    • 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