All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sikuli.basics.AnimatorOutQuarticEase Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
/*
 * Copyright (c) 2010-2019, sikuli.org, sikulix.com - MIT license
 */

package org.sikuli.basics;

public class AnimatorOutQuarticEase extends AnimatorTimeValueFunction {

  public AnimatorOutQuarticEase(float beginVal, float endVal, long totalTime) {
    super(beginVal, endVal, totalTime);
  }

  @Override
  public float getValue(long t) {
    if (t > _totalTime) {
      return _endVal;
    }
    double t1 = (double) t / _totalTime;
    double t2 = t1 * t1;
    return (float) (_beginVal
            + (_endVal - _beginVal) * (-1 * t2 * t2 + 4 * t1 * t2 - 6 * t2 + 4 * t1));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy