Java interpolate interpolate(float a, float b, float d)

Here you can find the source of interpolate(float a, float b, float d)

Description

interpolate

License

LGPL

Parameter

Parameter Description
a The first value
b The second value
d The interpolation factor, between 0 and 1

Return

a+(b-a)*d

Declaration

public static float interpolate(float a, float b, float d) 

Method Source Code

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

public class Main {
    /**//  w  w w.  j  av  a  2  s. co  m
     * @param a The first value
     * @param b The second value
     * @param d The interpolation factor, between 0 and 1
     * @return a+(b-a)*d
     */
    public static float interpolate(float a, float b, float d) {
        return a + (b - a) * d;
    }

    /**
     * @param a The first value
     * @param b The second value
     * @param d The interpolation factor, between 0 and 1
     * @return a+(b-a)*d
     */
    public static double interpolate(double a, double b, double d) {
        return a + (b - a) * d;
    }
}

Related

  1. interpolate(double x1, double x2, float zeroToOne)
  2. interpolate(final double min, final double max, final int currentClass, final int numOfClasses)
  3. interpolate(final float prev, final float curr, final float alpha)
  4. interpolate(final int n, final int lastN, final float interpolation)
  5. interpolate(final int x1, final double y1, final int x2, final double y2, final double... f)
  6. interpolate(float bottom, float top, float ratio)
  7. interpolate(float firstColor, float secondColor, float stage, float maxStages)
  8. interpolate(float s, float e, float t)
  9. interpolate(float t, float a, float b)