diff options
| author | Jacob Palecki <[email protected]> | 2020-08-13 01:52:49 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-13 01:52:49 -0700 |
| commit | 93a22c08b3223b040c3a3644fc3c4ef82fc576f0 (patch) | |
| tree | 336d99789e3dac52466c00fb5e07fc82a73c3bc8 /grapher/Models/Calculations/AccelChartData.cs | |
| parent | Almost working (diff) | |
| download | rawaccel-93a22c08b3223b040c3a3644fc3c4ef82fc576f0.tar.xz rawaccel-93a22c08b3223b040c3a3644fc3c4ef82fc576f0.zip | |
Dot to show mouse move
Diffstat (limited to 'grapher/Models/Calculations/AccelChartData.cs')
| -rw-r--r-- | grapher/Models/Calculations/AccelChartData.cs | 12 |
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); + } } } |