Here you can find the source of linearInterpolation(double y2, double y1, double deltaX, double x1)
Parameter | Description |
---|---|
y2 | the upper bound |
y1 | the lower bound |
deltaX | the delta x value |
x1 | the given x value |
public static double linearInterpolation(double y2, double y1, double deltaX, double x1)
//package com.java2s; /******************************************************************************* * <copyright> Copyright (c) 2014-2016 Bauhaus Luftfahrt e.V.. All rights reserved. This program and the accompanying * materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html </copyright> ******************************************************************************/ public class Main { /**/*from w w w . j a v a 2 s .c om*/ * Perform a linear interpolation calculation. * * @param y2 * the upper bound * @param y1 * the lower bound * @param deltaX * the delta x value * @param x1 * the given x value * @return the calculated y value at the position x1 */ public static double linearInterpolation(double y2, double y1, double deltaX, double x1) { return y2 - (y2 - y1) / deltaX * x1; } }