Commit Graph

1621 Commits

Author SHA1 Message Date
Joachim LF
9b17d1b882 [Update] Epsilon 15.3.1 2021-01-21 19:56:06 +01:00
Hugo Saint-Vignes
83722342f7 [apps/statistics] Reload CurveView before drawing histogram labels 2021-01-05 16:43:01 +01:00
Hugo Saint-Vignes
a42208f773 [apps/shared] Handle null labelStep in numberOfLabels 2021-01-05 16:33:48 +01:00
Hugo Saint-Vignes
9f0c7a87fd [apps/shared] Use sizeof data 2021-01-05 11:38:21 +01:00
Hugo Saint-Vignes
990c45b661 [apps/shared] Prevent label method from being called on uninitialized chars 2021-01-05 11:38:21 +01:00
Gabriel Ozouf
5b106f091d [interactive_curve_view_range] Fix isOrthonormal when using Navigate
The method isOrthonormal takes into account the "offscreen" portion of
the Y axis. This fixes a bug where zooming when using the Navigate
option would remove the orthonormality marker while the graph was still
orthonormal.
2021-01-05 11:01:45 +01:00
Gabriel Ozouf
abefc800d9 [interactive_curve_view_range] Fix variable type 2021-01-05 11:01:45 +01:00
Gabriel Ozouf
89c50509d8 [shared] InteractiveCurveViewRange::isOrthonormal
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
2021-01-05 11:01:45 +01:00
Gabriel Ozouf
ea4770fc81 [shared/interactive_curve_view_range] Change normalization tolerance
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.
2020-12-29 09:47:29 +01:00
Hugo Saint-Vignes
e09bd0a18c [poincare] Factorize reduce and removeUnit methods 2020-12-22 17:32:40 +01:00
Gabriel Ozouf
5bc9579db6 [shared/interactive_curve_view_range] Test zoom method 2020-12-22 17:22:33 +01:00
Gabriel Ozouf
e9c953fd6e [shared/interact_curve_view_range] Check orthonormality after zoom
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.
2020-12-22 17:22:33 +01:00
Hugo Saint-Vignes
1939293cd2 [apps/shared] Add margin to avoid visible approximation errors 2020-12-21 16:12:27 +01:00
Hugo Saint-Vignes
af3b2d4de4 [apps/shared] Tidy model name on sequence type change 2020-12-17 17:10:56 +01:00
Hugo Saint-Vignes
479f34502f [apps/shared] Rename methods and Factorize comparison logic 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
10c296e671 [apps/shared] Add comment for isCursorHanging method 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
7646f13ca8 [apps/shared] Fix NaN comparison in isCursorHanging method 2020-12-16 16:16:26 +01:00
Hugo Saint-Vignes
56a6917cfd [apps/shared] Fix context pointer when sorting rows 2020-12-16 11:40:54 +01:00
Gabriel Ozouf
625a89e610 [poincare/zoom] RefinedYRangeForDisplay signature 2020-12-10 13:45:56 +01:00
Gabriel Ozouf
3cdb076c2c [shared/interactive_curve_view_range] Factor zoom
The zoom method to zoom in and out on a curve view make use of the
SetZoom method in Poincare::Zoom.
2020-12-10 13:45:56 +01:00
Émilie Feral
fe4e2e3e9d Misc. clang static analyzer fixes 2020-12-09 13:34:36 +01:00
Gabriel Ozouf
ffebd2e987 [shared] Rename methods 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
316d054935 [sequence] Restore margins on the sequence graph 2020-12-07 15:58:56 +01:00
Gabriel Ozouf
f3b770cb29 [graph] Add tests for the full range computation
Change-Id: I040a36c035ec75ee950f1998667b70a417dea2f3
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
a9aeae94df [shared] Create helper functions for ranges
These functions are used to test the full algorithm used to compute
ranges.

Change-Id: I48069e245aa6e879f66aecc29709fc6f992f5220
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
b1da6031c6 [shared] Do not compute range for convoluted functions
Evaluating a function containing a sequence, an integral or a
derivative, is time consuming. Computing a range requires a plethora of
evaluations, as such ranges for these functions cannot be evaluated in a
timely fashion.

Change-Id: I088a0e896dbc26e6563291cafdfe9ceba36dd5d0
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
c89a7bc496 [graph] Take margins into account for normalization
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
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
a8858023ba [shared] Remove const qualifiers from interestingRanges
Change-Id: I794aa144af9dc9eab3090eea7fd54a7cdac2fd68
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
ff220b7103 [graph] Preserve default X range
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
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
6e9195fafa [shared] Add forceChangeY parameter to normalize()
Change-Id: Iff5417cd765f3fd09825b81cb41f883530b39233
2020-12-07 15:58:56 +01:00
Gabriel Ozouf
591f47d6a9 [continuous_function_cache] Coding style 2020-12-02 16:50:17 +01:00
Gabriel Ozouf
937979503a [shared/continous_function] Detach cache of inactive function
When a function that had previously been cached is deactivated, its
cache can be used by another function. When the function is reactivated,
if it tries to reuse its previous cache, it will be filled with values
from another function, and will not be cleared. By detaching the cache
of a function that becomes inactive, we ensure that the next time this
function is cached, the chache will be cleared.

e.g. Define to functions f(x)=x, g(x)=-x, draw them both.
     Deactivate f, the redraw the graph
     Reactivate f, the draw again
2020-12-02 16:50:17 +01:00
Gabriel Ozouf
3501146e35 [shared/continuous_function_cache] Detach cache from function
When three functions or more, the third function and later don't use
caching. But it is still possible for them to have been linked to a
cache (for instance if previous functions had been deactivated earlier).
To avoid a function tapping into another function's cache, we reset the
cache.

e.g. Define 3 functions f(x)=1, g(x)=2, h(x)=3, and deactivate f.
     Draw the graph, come back, reactivate f, then draw again.
---> The space between y=2 and y=3 will be filled with the color of h,
as h "remembers" using cache n°2, wich currently contains the values of
function g.
2020-12-02 16:50:17 +01:00
Gabriel Ozouf
56e03aae0c [shared] Remove angleUnitVersion
The angleUnitVersion check is no longer needed, as changing the angle
unit with a trigonometric function set would leave the cursor hanging.

Change-Id: I17d99c05daeacfec953865158cdfe7706635cd32
2020-11-24 09:55:22 +01:00
Gabriel Ozouf
5e679b7bc8 [graph] Change cursor initial position
The cursor now initially aligns with the grid, and tries to avoid points
where the function is not defined.

Change-Id: Ie3b304281f5848102c2f3c0aa5c031b351418186
2020-11-24 09:55:22 +01:00
Gabriel Ozouf
41778433b1 [graph] Fix a bug when zooming
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
2020-11-16 16:50:21 +01:00
Gabriel Ozouf
ea3e3287dc [graph] Keep Auto when opening and closing Navigate
If the user opens the Navigate menu, then closes it immediately, the
Auto status is not turned off.

Change-Id: I2d1ca0cfdae1b9c957dede7bf9f3c2890dea1bb0
2020-11-13 17:32:08 +01:00
Gabriel Ozouf
4233f197d3 [shared] Keep graph units when using navigation
When using the Navigate menu on graphs, the grid units are computed
using the normal graph's range, so that the units won't change.

Change-Id: I8ff8853868e5c90319619a6271d6a7d87ae82ab0
2020-11-13 10:50:31 +01:00
Léa Saviot
7f6a3f0fc1 [apps/curve_view] Fix KDCoordinate overflow
Scenario: (with the current auto zoom algorithm)
Graph f(x) = x! -> Auto axes are x=[-13,17647;13,17647],
y=[3628793;2628807]
Press "0" "EXE" to go to x = 0 -> Axes are x=[-13,17647;13,17647],
y=[-0.8612717;13.13873]
Press auto
Press "0" "EXE" to go to x = 0 -> the assertion about KDCoordinates
breaks.
2020-11-04 15:58:43 +01:00
Émilie Feral
a7b55776d6 [sequence] Remove unused function 2020-11-04 15:58:42 +01:00
Émilie Feral
c5beb6fdd2 [app/sequence] Test: avoid duplicating sequence stores and ensure to
tidy it (empty the Poincare Pool) between quiz_cases
2020-11-04 15:58:42 +01:00
Émilie Feral
5e83bee589 [apps/shared] ExpressionModel: expressionReduced can call itself so it
need to keep a valid m_expression
2020-11-04 15:58:42 +01:00
Hugo Saint-Vignes
8dc6391e92 [apps/shared] Prevent Array index overflow
Change-Id: I67ffcb71d0d62a3e67e6d63d2b30b0696800cb42
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
fe950386a0 [interactive_curve_view_range] Fix assert
Change-Id: I2ff3cfe90f10b33db3e18b321cf931c9f0946479
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
9e9033537c [WIP][interactive_curve_view_range] Tweak tolerance
Change-Id: Iacfb7de81a4ab8a7fb73770053e189d596016201
2020-11-04 15:58:37 +01:00
Gabriel Ozouf
ad7890a19c [interactive_curve_view_range] Missing refresh
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
2020-11-04 15:58:37 +01:00
Hugo Saint-Vignes
aa50a5eb7c [apps/shared] Silence warning for unused variable
Change-Id: I1df4a8c111688e00a82d4448d47fd571fec738e4
2020-11-04 15:58:36 +01:00
Gabriel Ozouf
3b24f9c2c3 [interactive_curve_view_range] Check auto status
Deactivate Auto status every time the range effectively changes.

Change-Id: I695b840d5e72061a73a229a6e726433660bdfdbf
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
5a5955b513 [interactive_curve_view_range] Status unchanged
Only notify the delegate to the refresh the button when the status has
changed.

Change-Id: I6689d2c292ff96039a68cd1b437b18df5fb98829
2020-11-04 15:58:31 +01:00
Gabriel Ozouf
82a77df088 [interactive_curve_view_range] Missing resets
Added some missing resets of the Auto and Normalize statuses

Change-Id: I5514a2566c1f6ba73d04b526402b428b2edce4b4
2020-11-04 15:58:31 +01:00