Java Lerp lerp(double min, double max, double val)

Here you can find the source of lerp(double min, double max, double val)

Description

Linear interpolation

License

LGPL

Declaration

public static double lerp(double min, double max, double val) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /** Linear interpolation */
    public static double lerp(double min, double max, double val) {
        return (1.0 - val) * min + val * max;
    }/*from  w  w  w  . ja v  a2 s. c  om*/

    /** Linear interpolation */
    public static int lerp(int min, int max, double val) {
        return Long.valueOf(Math.round((1.0 - val) * min + val * max)).intValue();
    }
}

Related

  1. lerp(double amt, double start, double end)
  2. lerp(double distance, double firstPoint, double secondPoint)
  3. lerp(double from, double to, double p)
  4. lerp(double from, double to, double progress)
  5. lerp(double min, double max, double percentage)
  6. lerp(double start, double distance, double factor)
  7. lerp(double v1, double v2, double amt)
  8. lerp(double x, double x1, double x2, double q00, double q01)
  9. lerp(double x, double x1, double x2, double q00, double q01)