Interface Interpolation

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Interpolation
Interpolation methods. Some of these were converted from Flash ActionScript implementations explained in the article http://gizma.com/easing/.

The JavaDoc for each interpolation method includes a graphical example in ASCII art to visualize the interpolation curve.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Interpolation
    Cubic easing interpolation.
    static final Interpolation
    Discrete interpolation.
    static final Interpolation
    Easing interpolation.
    static final Interpolation
    Linear interpolation.
    static final Interpolation
    Quadratic easing interpolation.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    interpolate(float x0, float x1, float delta)
    Returns the interpolated value between x0 and x1.
  • Field Details

    • DISCRETE

      static final Interpolation DISCRETE
      Discrete interpolation.

       . . . . . . . . x
       . . . . . . . . .
       . . . . . . . . .
       . . . . . . . . .
       . . . . . . . . .
       . . . . . . . . .
       . . . . . . . . .
       . . . . . . . . .
       x x x x x x x x .
       
    • LINEAR

      static final Interpolation LINEAR
      Linear interpolation.

       . . . . . . . . x
       . . . . . . . x .
       . . . . . . x . .
       . . . . . x . . .
       . . . . x . . . .
       . . . x . . . . .
       . . x . . . . . .
       . x . . . . . . .
       x . . . . . . . .
       
    • EASE

      static final Interpolation EASE
      Easing interpolation.

       . . . . . . . x x
       . . . . . . x . .
       . . . . . . . . .
       . . . . . x . . .
       . . . . x . . . .
       . . . . . . . . .
       . . . x . . . . .
       . . x . . . . . .
       x x . . . . . . .
       
    • CUBIC

      static final Interpolation CUBIC
      Cubic easing interpolation.

       . . . . . . x x x
       . . . . . . . . .
       . . . . . x . . .
       . . . . . . . . .
       . . . . . . . . .
       . . . . x . . . .
       . . . . . . . . .
       . . . x . . . . .
       x x x . . . . . .
       
    • QUADRATIC

      static final Interpolation QUADRATIC
      Quadratic easing interpolation.

       . . . . . . . x x
       . . . . . . x . .
       . . . . . . . . .
       . . . . . x . . .
       . . . . x . . . .
       . . . . . . . . .
       . . . x . . . . .
       . . . . . . . . .
       x x x . . . . . .
       
  • Method Details

    • interpolate

      float interpolate(float x0, float x1, float delta)
      Returns the interpolated value between x0 and x1. The value of delta is a number between 0 and 1 describing how much of the animation has been completed.