summaryrefslogtreecommitdiff
path: root/grapher/Models/Calculations/AccelChartData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'grapher/Models/Calculations/AccelChartData.cs')
-rw-r--r--grapher/Models/Calculations/AccelChartData.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs
index 243827a..a3354aa 100644
--- a/grapher/Models/Calculations/AccelChartData.cs
+++ b/grapher/Models/Calculations/AccelChartData.cs
@@ -27,5 +27,17 @@ namespace grapher.Models.Calculations
VelocityPoints.Clear();
GainPoints.Clear();
}
+
+ public (double, double, double) FindInValuesFromOut(double outVelocityValue)
+ {
+ var velIdx = ~VelocityPoints.Values.ToList().BinarySearch(outVelocityValue);
+
+ if (velIdx < 0)
+ {
+ velIdx = ~velIdx;
+ }
+
+ return (VelocityPoints.ElementAt(velIdx).Key, AccelPoints.ElementAt(velIdx).Value, GainPoints.ElementAt(velIdx).Value);
+ }
}
}