Java Lerp lerp(float value1, float value2, float amount)

Here you can find the source of lerp(float value1, float value2, float amount)

Description

Interpolates between value1 and value2 by amount.

License

Open Source License

Parameter

Parameter Description
value1 a parameter
value2 a parameter
amount a value between 0 and 1.

Return

An interpolated value.

Declaration

public static float lerp(float value1, float value2, float amount) 

Method Source Code

//package com.java2s;
// file 'LICENSE', which is part of this source code package.

public class Main {
    /**/*from  w w w .j  a  v a  2s  . co m*/
     * Interpolates between value1 and value2 by amount.
     * @param value1
     * @param value2
     * @param amount a value between 0 and 1.
     * @return An interpolated value.
     */
    public static float lerp(float value1, float value2, float amount) {
        return value1 + (value2 - value1) * amount;
    }
}

Related

  1. lerp(float origin, float target, int steps, int maxSteps)
  2. lerp(float start, float stop, float amt)
  3. lerp(float target, float current, float factor)
  4. lerp(float to, float from, float f)
  5. lerp(float va, float vb, float t)
  6. lerp(int a, int b, float value)
  7. lerp(int a, int b, int mul, int div)
  8. lerpa(double a1, double a2, double t)
  9. lerpAndPremultiplyColorWithAlpha(float t, int[] color1, int[] color2)