The old method isOrthonormal has been split into two :
- shouldBeNormalized tests whether the range is close enough to a
normal range
- isOrthonormal tests whether the range is strictly orthonormal, but
takes into account imprecisions of floating-point arithmetic
The loss of significance that occurs when subtracting the bounds of the
axes must be taken into account when asserting whether the range is
orthonormal.
Zooming in and out on a graph usually preserves orthonormality. However,
if the window has its bounds close to the limits for the values on the
axes, zooming can change the ratio.
When building an orthonormal range for the automatic zoom, we provide a
ratio for the screen without the margins. This way, adding the margins
will make the graph orthonormal, and the banner cannot cover the
function.
Change-Id: If3a3f799d4e7e3e81ab77c6b418d70b734a6fbca
When computing the automatic zoom, if the X axis has integer bounds
(most likely because the range has been built to be orthonormal), do not
add margins to the X axis, so that it keeps user friendly values.
Change-Id: I49d99b79c68fbd8a49e5c2521b250c40aad75d48
When entering the Navigate menu, a portion of the Y axis is memoized to
preserve the grid units.
However, this portion was not modified when zooming, causing some
glitches.
Change-Id: I06b4ee044eaa75d48b8f338c9ef6ea33bb299e39
Fixes the following bug :
- Plot ln(x) (or any other curve that's normlalized by default)
- Go back and replace ln(x) with log(x) (or any other curve that's NOT
normalized by default)
--> The 'Equal Axes' button is still on.
Change-Id: I0ef50dc9866e908894bd4f5c3ade198f9b3ea318
Checking wether the range that has been computed is suitable is now
done in Poincare::Zoom by SanitizeRange.
Change-Id: Ib7ff73a3beae29996b1a773744021ad85c6ba946
Rework the logic so that :
- an undefined function will be displayed with a clealry defined
null range.
- display both an undefined function and a correct function at the
same time will not affect the correct range.
Change-Id: Ife9dc0d2ace667cab5a6b8826347078fca33e4d5
Added a tolerance when checking orthonormality, so that ranges that are
nearly orthonormal will be made orthonormal.
Change-Id: Ie3bf076086561e3ff6374e7daa9dd1a884c52d5a
The normalized status would not be refreshed after a call to setDefault
triggered by InteractiveCurveViewController::viewWillAppear.
Change-Id: I923ef3ca0585dbcc1f32b992d7dd1f4a3a206532
The method FunctionGraphController::yRangeForCursorFirstMove expands the
Y range to include the values of the first cursor moves on the left and
the right of the center. It has been modified to preserve
orthonormality.
Change-Id: I898ab9721e45e2acde261f8b94b80cab81b39a92
Added a method to Zoom to set a range to a specific ratio. This method
is used by InteractiveCurveViewRange::normalize.
Change-Id: Id3029439294ece02ea19fb6c6de90b9edc85d771
The Auto mode for curve ranges must be deactivated when moving the
cursor outside the screen and when activating navigation (formerly
Zoom).
Change-Id: I281a1d069c2ebcc30e7ead469c4f48438054d7c2
Additional checks have been added to ensure that the first move of the
cursor from the center of the graph would not cause the window to pan up
or down.
Change-Id: I44d7e86223941076cbf03db7a221e9c0427a64e4
Initial zoom for displaying curves is computed according to the
following rules :
- For polar and parametric curves, the algorithm has not changed.
Vertical and horizontal ranges are chosen in order to display the
full curve with orthonormal graduations.
- For cartesian curves, the horizontal range is chosen in order to
display all points of interest (roots, extrema, asymptotes...).
The vertical range is fitted to be able to display those points, but
also cuts out points outside of the function's order of magnitude.
Change-Id: Idf8233fc2e6586b85d34c4da152c83e75513d85c
Method InteractiveCurveViewRange::panToMakePointVisible now moves the
range of a whole number of pixels when panning horizontally. This allows
the cache of cartesian functions not to be invalidated.
Change-Id: Idb9904fef134dd13458e1f2287b0fe5145e8aec7
Scenario : f(x)=8x, scroll to the right until the window range has
changed, then set the preadjustment to default -> the x change had no
impact on the yRange because we did not set the yAuto before doing the
changes.
When setting the axes then putting on the orthnormalization, 2 * (max of
the two axes units) is put to 1 cm instead of doing 2 units = 1cm. This
roughly keeps the configuration of the window.