Here you can find the source of lerp(final float x, final float x1, final float x2, final float q00, final float q01)
Parameter | Description |
---|---|
x | a parameter |
q00 | a parameter |
q01 | a parameter |
x1 | a parameter |
x2 | a parameter |
private static float lerp(final float x, final float x1, final float x2, final float q00, final float q01)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Andreas H?hmann/*from w ww. ja va 2 s. co m*/ * * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *******************************************************************************/ public class Main { /** * @param x * @param q00 * @param q01 * @param x1 * @param x2 * @return */ private static float lerp(final float x, final float x1, final float x2, final float q00, final float q01) { return (x2 - x) / (x2 - x1) * q00 + (x - x1) / (x2 - x1) * q01; } }