Java interpolate interpolate(final int n, final int lastN, final float interpolation)

Here you can find the source of interpolate(final int n, final int lastN, final float interpolation)

Description

interpolate

License

Open Source License

Declaration

public static int interpolate(final int n, final int lastN, final float interpolation) 

Method Source Code

//package com.java2s;
/*/*from  w w w. java  2 s  .c  om*/
 *  Copyright (C) 2011-2014 Brian Groenke
 *  All rights reserved.
 * 
 *  This file is part of the 2DX Graphics Library.
 *
 *  This Source Code Form is subject to the terms of the
 *  Mozilla Public License, v. 2.0. If a copy of the MPL 
 *  was not distributed with this file, You can obtain one at 
 *  http://mozilla.org/MPL/2.0/.
 */

public class Main {
    public static int interpolate(final int n, final int lastN, final float interpolation) {

        return Math.round(((n - lastN) * interpolation + lastN));
    }
}

Related

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