Closed veillette closed 1 year ago
This was noted while trying to reproduce https://github.com/phetsims/calculus-grapher/issues/241.
The tilt mode makes an assumption that the point at x=0 is zero, which is the source of the problem.
Although the problem was easily identified, it took me a while to come to a solution.
As as result of the commit above, the maxTilt
in CalculusGrapherQueryParameters
is no longer an angle but a slope.
The maxTilt
value is set to 3
It turns out to be simpler to calculate offsets based on difference in slopes rather than difference in angles.
I have tested it a bit and it works as expected.
The maximum slope that can be seen by manipulated the Shift
and Tilt
mode is the following.
The commit for this issue can be found https://github.com/phetsims/calculus-grapher/commit/e9a2b4bde836940df291c48bb37abece0fb77c62
The previous implementation limited the relative slope (measure by the added slope added by the user) to be below a threshold. However, successive user manipulations would allow a user to create a slope that was nearly infinite. The new approach is to determine the absolute slope of the curve and ensure that it is never above a threshold (currently set to 3). Assigning to @pixelzoom to review and close if appropriate.
Looks and behaves reasonably to me! Closing.
In tilt mode, the maximum tilt of the line should be 45 degrees. However the max tilt is not respected if the curve at at x=0 is not y=0.