Module io.virtdata.lib.basics
Class Interpolate
- java.lang.Object
-
- io.virtdata.libbasics.shared.from_long.to_long.Interpolate
-
- All Implemented Interfaces:
java.util.function.LongUnaryOperator
public class Interpolate extends java.lang.Object implements java.util.function.LongUnaryOperatorReturn a value along an interpolation curve. This allows you to sketch a basic density curve and describe it simply with just a few values. The number of values provided determines the resolution of the internal lookup table that is used for interpolation. The first value is always the 0.0 anchoring point on the unit interval. The last value is always the 1.0 anchoring point on the unit interval. This means that in order to subdivide the density curve in an interesting way, you need to provide a few more values in between them. Providing two values simply provides a uniform sample between a minimum and maximum value. The input range of this function is, as many of the other functions in this library, based on the valid range of positive long values, between 0L and Long.MAX_VALUE inclusive. This means that if you want to combine interpolation on this curve with the effect of pseudo-random sampling, you need to put a hash function ahead of it in the flow.
-
-
Constructor Summary
Constructors Constructor Description Interpolate(double... value)Interpolate(int resolution, double[] lut)Interpolate(long... value)
-
Method Summary
Modifier and Type Method Description longapplyAsLong(long input)
-