From badd0905381658cf3190909e116df5c5f10f5865 Mon Sep 17 00:00:00 2001 From: bovlb <31326650+bovlb@users.noreply.github.com> Date: Fri, 24 May 2024 13:35:42 -0400 Subject: [PATCH] [wpimath] Document example usage for InterpolatingDoubleTreeMap (NFC) (#6456) --- .../interpolation/InterpolatingDoubleTreeMap.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wpimath/src/main/java/edu/wpi/first/math/interpolation/InterpolatingDoubleTreeMap.java b/wpimath/src/main/java/edu/wpi/first/math/interpolation/InterpolatingDoubleTreeMap.java index 010d232146..bfc28dbacd 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/interpolation/InterpolatingDoubleTreeMap.java +++ b/wpimath/src/main/java/edu/wpi/first/math/interpolation/InterpolatingDoubleTreeMap.java @@ -9,6 +9,17 @@ import java.util.Map; /** * 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
+ * 
*/ public class InterpolatingDoubleTreeMap extends InterpolatingTreeMap { /** Default constructor. */