Gephi Toolkit Javadoc

org.gephi.ranking.api
Class Interpolator

java.lang.Object
  extended by org.gephi.ranking.api.Interpolator
Direct Known Subclasses:
Interpolator.BezierInterpolator

public abstract class Interpolator
extends java.lang.Object

Abstract clas that defines the single interpolate(float) method. This abstract class is implemented by built-in interpolators.

Author:
Mathieu Bastian

Nested Class Summary
static class Interpolator.BezierInterpolator
          Bezier curve interpolator.
 
Field Summary
static Interpolator LINEAR
          Linear interpolation x = interpolate(x)
static Interpolator LOG2
          Log2 interpolation Math.log(1 + x)/Math.log(2) = interpolate(x)
 
Constructor Summary
Interpolator()
           
 
Method Summary
abstract  float interpolate(float x)
          This function takes an input value between 0 and 1 and returns another value, also between 0 and 1.
static Interpolator newBezierInterpolator(float px1, float py1, float px2, float py2)
          Builds a bezier interpolator with two control points (px1, py1) and (px2, py2).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEAR

public static final Interpolator LINEAR
Linear interpolation x = interpolate(x)


LOG2

public static final Interpolator LOG2
Log2 interpolation Math.log(1 + x)/Math.log(2) = interpolate(x)

Constructor Detail

Interpolator

public Interpolator()
Method Detail

newBezierInterpolator

public static Interpolator newBezierInterpolator(float px1,
                                                 float py1,
                                                 float px2,
                                                 float py2)
Builds a bezier interpolator with two control points (px1, py1) and (px2, py2). The points should all be in range [0, 1].

Parameters:
px1 - the x-coordinate of first control point, between [0, 1]
py1 - the y-coordinate of first control point, between [0, 1]
px2 - the x-coordinate of second control point, between [0, 1]
py2 - the y-coordinate of second control point, between [0, 1]
Returns:
new bezier interpolator

interpolate

public abstract float interpolate(float x)
This function takes an input value between 0 and 1 and returns another value, also between 0 and 1.

Parameters:
x - a value between 0 and 1
Returns:
a value between 0 and 1. Values outside of this boundary may be clamped to the interval [0,1] and cause undefined results.

Gephi Toolkit Javadoc