Class HalfCosineInterpolator

java.lang.Object
com.softsynth.jmsl.util.HalfCosineInterpolator
All Implemented Interfaces:
Interpolator

public class HalfCosineInterpolator
extends java.lang.Object
implements Interpolator
Interpolate a value along an S curve (half cosine)
Author:
Nick Didkovsky
  • Constructor Summary

    Constructors
    Constructor Description
    HalfCosineInterpolator​(double t1, double v1, double t2, double v2)
    Construct a linear interpolator that intersects two specified points
  • Method Summary

    Modifier and Type Method Description
    double interp​(double t)
    Given the input t, return the value along the half cosine function
    static void main​(java.lang.String[] args)
    build an interpolator and print 20 points along the line
    void setInterp​(double t1, double v1, double t2, double v2)
    Set the interpolator to calculate points along the line intersecting two specified points
    java.lang.String toString()
    print me

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HalfCosineInterpolator

      public HalfCosineInterpolator​(double t1, double v1, double t2, double v2)
      Construct a linear interpolator that intersects two specified points
  • Method Details

    • setInterp

      public void setInterp​(double t1, double v1, double t2, double v2)
      Set the interpolator to calculate points along the line intersecting two specified points
      Specified by:
      setInterp in interface Interpolator
    • interp

      public double interp​(double t)
      Given the input t, return the value along the half cosine function
      Specified by:
      interp in interface Interpolator
    • toString

      public java.lang.String toString()
      print me
      Overrides:
      toString in class java.lang.Object
    • main

      public static void main​(java.lang.String[] args)
      build an interpolator and print 20 points along the line