diff options
| author | Jacob Palecki <[email protected]> | 2021-01-22 19:08:11 -0800 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-01-22 19:08:11 -0800 |
| commit | 7479114121b6c91812b68b598ca360f4d916cb93 (patch) | |
| tree | c0f736fe8f462b8fb87e32b194b73d4b321585e5 | |
| parent | Merge pull request #67 from JacobPalecki/graph_fix (diff) | |
| download | rawaccel-7479114121b6c91812b68b598ca360f4d916cb93.tar.xz rawaccel-7479114121b6c91812b68b598ca360f4d916cb93.zip | |
Fix graphing error in by component graph calculation
| -rw-r--r-- | grapher/Models/Calculations/AccelCalculator.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/grapher/Models/Calculations/AccelCalculator.cs b/grapher/Models/Calculations/AccelCalculator.cs index 60c6eaa..d641873 100644 --- a/grapher/Models/Calculations/AccelCalculator.cs +++ b/grapher/Models/Calculations/AccelCalculator.cs @@ -136,6 +136,11 @@ namespace grapher.Models.Calculations var ratio = outMagnitude / simulatedInputDatum.velocity; var slope = inDiff > 0 ? outDiff / inDiff : starter; + if (slope < lastSlope) + { + Console.WriteLine(); + } + if (ratio > maxRatio) { maxRatio = ratio; @@ -398,8 +403,8 @@ namespace grapher.Models.Calculations var timeFactor = ceil / i; mouseInputData.x = 0; mouseInputData.y = ceil; - mouseInputData.time = MeasurementTime; - mouseInputData.velocity = Velocity(0, i, mouseInputData.time); + mouseInputData.time = MeasurementTime*timeFactor; + mouseInputData.velocity = Velocity(0, ceil, mouseInputData.time); mouseInputData.angle = Math.PI / 2; magnitudes.Add(mouseInputData); } |