summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-21 12:41:16 -0700
committerJacob Palecki <[email protected]>2020-09-21 12:41:16 -0700
commit99ad8686bb039dcf82115550dbf347d8695ee1f8 (patch)
treec4aead24d52e3002cfd3282ddd697a3766de405a
parentseparate x/y mostly works (diff)
downloadrawaccel-99ad8686bb039dcf82115550dbf347d8695ee1f8.tar.xz
rawaccel-99ad8686bb039dcf82115550dbf347d8695ee1f8.zip
x/y diff sens works
-rw-r--r--grapher/Models/Calculations/AccelChartData.cs5
-rw-r--r--grapher/Models/Calculations/AccelData.cs2
2 files changed, 6 insertions, 1 deletions
diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs
index 907eb0e..fbf1944 100644
--- a/grapher/Models/Calculations/AccelChartData.cs
+++ b/grapher/Models/Calculations/AccelChartData.cs
@@ -66,6 +66,11 @@ namespace grapher.Models.Calculations
return (AccelPoints.ElementAt(index).Value, VelocityPoints.ElementAt(index).Value, GainPoints.ElementAt(index).Value);
}
+ public (double, double, double) ValuesAtInVelocity(double inVelocity)
+ {
+ return (AccelPoints[inVelocity], VelocityPoints[inVelocity], GainPoints[inVelocity]);
+ }
+
public int GetVelocityIndex(double outVelocityValue)
{
var velIdx = OrderedVelocityPointsList.BinarySearch(outVelocityValue);
diff --git a/grapher/Models/Calculations/AccelData.cs b/grapher/Models/Calculations/AccelData.cs
index 0fe7a3c..67d4f3f 100644
--- a/grapher/Models/Calculations/AccelData.cs
+++ b/grapher/Models/Calculations/AccelData.cs
@@ -99,7 +99,7 @@ namespace grapher.Models.Calculations
else
{
var index = Combined.GetVelocityIndex(outVelocity);
- var inVelocity = Combined.VelocityPoints.ElementAt(index).Value;
+ var inVelocity = Combined.VelocityPoints.ElementAt(index).Key;
var xPoints = X.ValuesAtIndex(index);
var yPoints = Y.ValuesAtIndex(index);
OutVelocityToPoints.Add(outVelocity, (inVelocity, xPoints.Item1, xPoints.Item2, xPoints.Item3, yPoints.Item1, yPoints.Item2, yPoints.Item3));