sdr 0.7

net.cscott.sdr.util
Class Bezier

java.lang.Object
  extended by net.cscott.sdr.util.Bezier

public class Bezier
extends Object

Utility methods for efficiently evaluating bezier curves.


Nested Class Summary
static class Bezier.Bezier2D
          Bundle bezier parameters together into an object
 
Method Summary
static float cubicDeriv(float p0, float p1, float p2, float p3, float t)
          Evaluate the derivative of a cubic bezier with the given four control points.
static Fraction cubicDeriv(Fraction p0, Fraction p1, Fraction p2, Fraction p3, Fraction t)
          Evaluate the derivative of a cubic bezier with the given four control points.
static double cubicInterp(double p0, double p1, double p2, double p3, double t)
          Evaluate a cubic bezier with the given four control points.
static float cubicInterp(float p0, float p1, float p2, float p3, float t)
          Evaluate a cubic bezier with the given four control points.
static Fraction cubicInterp(Fraction p0, Fraction p1, Fraction p2, Fraction p3, Fraction t)
          Evaluate a cubic bezier with the given four control points.
static double quadInterp(double p0, double p1, double p2, double t)
          Evaluate a quadratic bezier with the given three control points.
static float quadInterp(float p0, float p1, float p2, float t)
          Evaluate a quadratic bezier with the given three control points.
static Fraction quadInterp(Fraction p0, Fraction p1, Fraction p2, Fraction t)
          Evaluate a quadratic bezier with the given three control points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cubicInterp

public static float cubicInterp(float p0,
                                float p1,
                                float p2,
                                float p3,
                                float t)
Evaluate a cubic bezier with the given four control points. The time argument should be between 0 and 1, inclusive.


cubicInterp

public static double cubicInterp(double p0,
                                 double p1,
                                 double p2,
                                 double p3,
                                 double t)
Evaluate a cubic bezier with the given four control points. The time argument should be between 0 and 1, inclusive.


cubicInterp

public static Fraction cubicInterp(Fraction p0,
                                   Fraction p1,
                                   Fraction p2,
                                   Fraction p3,
                                   Fraction t)
Evaluate a cubic bezier with the given four control points. The time argument should be between 0 and 1, inclusive.


cubicDeriv

public static float cubicDeriv(float p0,
                               float p1,
                               float p2,
                               float p3,
                               float t)
Evaluate the derivative of a cubic bezier with the given four control points.


cubicDeriv

public static Fraction cubicDeriv(Fraction p0,
                                  Fraction p1,
                                  Fraction p2,
                                  Fraction p3,
                                  Fraction t)
Evaluate the derivative of a cubic bezier with the given four control points.


quadInterp

public static float quadInterp(float p0,
                               float p1,
                               float p2,
                               float t)
Evaluate a quadratic bezier with the given three control points. The time argument should be between 0 and 1, inclusive.


quadInterp

public static double quadInterp(double p0,
                                double p1,
                                double p2,
                                double t)
Evaluate a quadratic bezier with the given three control points. The time argument should be between 0 and 1, inclusive.


quadInterp

public static Fraction quadInterp(Fraction p0,
                                  Fraction p1,
                                  Fraction p2,
                                  Fraction t)
Evaluate a quadratic bezier with the given three control points. The time argument should be between 0 and 1, inclusive.


sdr 0.7

Copyright © 2006-2009 C. Scott Ananian