Package org.gephi.appearance.api
Class Interpolator.BezierInterpolator
- java.lang.Object
-
- org.gephi.appearance.api.Interpolator
-
- org.gephi.appearance.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].
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.gephi.appearance.api.Interpolator
Interpolator.BezierInterpolator
-
-
Field Summary
-
Fields inherited from class org.gephi.appearance.api.Interpolator
LINEAR, LOG2
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Point2D
getControl1()
Point2D
getControl2()
int
hashCode()
float
interpolate(float x)
get the y-value of the cubic bezier curve that corresponds to the x input-
Methods inherited from class org.gephi.appearance.api.Interpolator
newBezierInterpolator
-
-
-
-
Constructor Detail
-
BezierInterpolator
public 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]
-
-
Method Detail
-
getControl1
public Point2D getControl1()
-
getControl2
public Point2D getControl2()
-
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 classInterpolator
- 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]
-
-