edu.umd.cs.jazz.util
Class ZUtil

java.lang.Object
  |
  +--edu.umd.cs.jazz.util.ZUtil

public class ZUtil
extends java.lang.Object

Provide some generic, useful routines


Constructor Summary
ZUtil()
           
 
Method Summary
static double lerp(double t, double a, double b)
          Linearly interpolates between a and b, based on t.
static float lerp(float t, float a, float b)
          Linearly interpolates between a and b, based on t.
static double sisoLerp(double t)
          Map the input linear lerp (a linear interpolation from (0-1) to a slow-in, slow-out lerp.
static float sisoLerp(float t)
          Map the input linear lerp (a linear interpolation from (0-1) to a slow-in, slow-out lerp.
static void transform(java.awt.geom.Rectangle2D rect, java.awt.geom.AffineTransform tf)
          Apply the specified transform to the specified rectangle, modifying the rect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZUtil

public ZUtil()
Method Detail

lerp

public static float lerp(float t,
                         float a,
                         float b)
Linearly interpolates between a and b, based on t. Specifically, it computes lerp(a, b, t) = a + t*(b - a). This produces a result that changes from a (when t = 0) to b (when t = 1).
Parameters:
a - from point
b - to Point
t - variable 'time' parameter

lerp

public static double lerp(double t,
                          double a,
                          double b)
Linearly interpolates between a and b, based on t. Specifically, it computes lerp(a, b, t) = a + t*(b - a). This produces a result that changes from a (when t = 0) to b (when t = 1).
Parameters:
a - from point
b - to Point
t - variable 'time' parameter

sisoLerp

public static float sisoLerp(float t)
Map the input linear lerp (a linear interpolation from (0-1) to a slow-in, slow-out lerp.
Parameters:
t -  

sisoLerp

public static double sisoLerp(double t)
Map the input linear lerp (a linear interpolation from (0-1) to a slow-in, slow-out lerp.
Parameters:
t -  

transform

public static void transform(java.awt.geom.Rectangle2D rect,
                             java.awt.geom.AffineTransform tf)
Apply the specified transform to the specified rectangle, modifying the rect.