Package edu.wpi.first.math.interpolation
Class InterpolatingDoubleTreeMap
java.lang.Object
edu.wpi.first.math.interpolation.InterpolatingTreeMap<Double,Double>
edu.wpi.first.math.interpolation.InterpolatingDoubleTreeMap
Interpolating Tree Maps are used to get values at points that are not defined by making a guess
from points that are defined. This uses linear interpolation.
Example of use:
InterpolatingDoubleTreeMap table = new InterpolatingDoubleTreeMap();
table.put(0.0, 0.0);
table.put(1.0, 10.0);
table.put(2.0, 30.0);
// ...
double result = table.get(1.5); // Returns 20.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic InterpolatingDoubleTreeMap
Creates anInterpolatingDoubleTreeMap
from the given entries.Methods inherited from class edu.wpi.first.math.interpolation.InterpolatingTreeMap
clear, get, put
-
Constructor Details
-
InterpolatingDoubleTreeMap
public InterpolatingDoubleTreeMap()Default constructor.
-
-
Method Details
-
ofEntries
@SafeVarargs public static InterpolatingDoubleTreeMap ofEntries(Map.Entry<Double, Double>... entries) Creates anInterpolatingDoubleTreeMap
from the given entries.- Parameters:
entries
- The entries to add to the map.- Returns:
- The map filled with the
entries
.
-