plugins.big.bigsnakeutils.icy.gui.curve
Class PolynomialCurve

java.lang.Object
  extended by plugins.big.bigsnakeutils.icy.gui.curve.Curve
      extended by plugins.big.bigsnakeutils.icy.gui.curve.PolynomialCurve

public class PolynomialCurve
extends Curve

Class describing a polynomial Curve. If the Curve owns N control points, the PolynomialCurve is a polynom of degree N-1 interpolating the control points.

Version:
May 3, 2014
Author:
Julien Jacquemot

Constructor Summary
PolynomialCurve()
          Default constructor
PolynomialCurve(double y0, double y1)
          Constructs the curve specifying the position of the first and last points.
PolynomialCurve(PolynomialCurve other)
          Copy constructor
PolynomialCurve(java.util.Vector<java.awt.geom.Point2D> points)
          Default constructor.
 
Method Summary
 void clear()
          Remove all the control points except the first and the last ones.
 Curve clone()
           
 void insertControlPoint(int index, java.awt.geom.Point2D point)
          Inserts a control point at the given index.
 void removeControlPoint(int index)
          Removes a control point.
 void setControlPoint(int index, java.awt.geom.Point2D point)
          Set the control point for the given index.
 void setControlPoints(java.util.Vector<java.awt.geom.Point2D> points)
          Set the list of the control points.
 double valueAt(double x)
          Returns the value of the curve for the abscissa x.
 
Methods inherited from class plugins.big.bigsnakeutils.icy.gui.curve.Curve
count, equals, getControlPoint, getControlPoints, insertControlPoint, setControlPoint
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolynomialCurve

public PolynomialCurve()
Default constructor


PolynomialCurve

public PolynomialCurve(double y0,
                       double y1)
Constructs the curve specifying the position of the first and last points.


PolynomialCurve

public PolynomialCurve(java.util.Vector<java.awt.geom.Point2D> points)
Default constructor.

Parameters:
points - Control points

PolynomialCurve

public PolynomialCurve(PolynomialCurve other)
Copy constructor

Method Detail

setControlPoints

public void setControlPoints(java.util.Vector<java.awt.geom.Point2D> points)
Description copied from class: Curve
Set the list of the control points.

Specified by:
setControlPoints in class Curve

insertControlPoint

public void insertControlPoint(int index,
                               java.awt.geom.Point2D point)
Description copied from class: Curve
Inserts a control point at the given index.

Specified by:
insertControlPoint in class Curve

removeControlPoint

public void removeControlPoint(int index)
Description copied from class: Curve
Removes a control point.

Specified by:
removeControlPoint in class Curve

setControlPoint

public void setControlPoint(int index,
                            java.awt.geom.Point2D point)
Description copied from class: Curve
Set the control point for the given index.

Specified by:
setControlPoint in class Curve

clear

public void clear()
Description copied from class: Curve
Remove all the control points except the first and the last ones.

Specified by:
clear in class Curve

valueAt

public double valueAt(double x)
Description copied from class: Curve
Returns the value of the curve for the abscissa x.

Specified by:
valueAt in class Curve

clone

public Curve clone()
Specified by:
clone in class Curve