All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.machinezoo.sourceafis.Doubles Maven / Gradle / Ivy

// Part of SourceAFIS for Java: https://sourceafis.machinezoo.com/java
package com.machinezoo.sourceafis;

class Doubles {
	static double sq(double value) {
		return value * value;
	}
	static double interpolate(double start, double end, double position) {
		return start + position * (end - start);
	}
	static double interpolate(double bottomleft, double bottomright, double topleft, double topright, double x, double y) {
		double left = interpolate(topleft, bottomleft, y);
		double right = interpolate(topright, bottomright, y);
		return interpolate(left, right, x);
	}
	static double interpolateExponential(double start, double end, double position) {
		return Math.pow(end / start, position) * start;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy