org.gephi.ranking.api
Class Interpolator.BezierInterpolator
java.lang.Object
org.gephi.ranking.api.Interpolator
org.gephi.ranking.api.Interpolator.BezierInterpolator
- Enclosing class:
- Interpolator
public static class Interpolator.BezierInterpolator
- extends Interpolator
Bezier curve interpolator.
Basically, a cubic Bezier curve is created with start point (0,0) and
endpoint (1,1). The other two control points (px1, py1) and (px2, py2) are
given by the user, where px1, py1, px1, and px2 are all in the range [0,1].
|
Constructor Summary |
Interpolator.BezierInterpolator(float px1,
float py1,
float px2,
float py2)
constructor -- cubic bezier curve will be represented by control points
(0,0) (px1,py1) (px2,py2) (1,1) -- px1, py1, px2, py2 all in range [0,1] |
|
Method Summary |
float |
interpolate(float x)
get the y-value of the cubic bezier curve that corresponds to the x input |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Interpolator.BezierInterpolator
public Interpolator.BezierInterpolator(float px1,
float py1,
float px2,
float py2)
- constructor -- cubic bezier curve will be represented by control points
(0,0) (px1,py1) (px2,py2) (1,1) -- px1, py1, px2, py2 all in range [0,1]
- Parameters:
px1 - is x-coordinate of first control point, in range [0,1]py1 - is y-coordinate of first control point, in range [0,1]px2 - is x-coordinate of second control point, in range [0,1]py2 - is y-coordinate of second control point, in range [0,1]
interpolate
public float interpolate(float x)
- get the y-value of the cubic bezier curve that corresponds to the x input
- Specified by:
interpolate in class Interpolator
- Parameters:
x - is x-value of cubic bezier curve, in range [0,1]
- Returns:
- corresponding y-value of cubic bezier curve -- in range [0,1]