Commit Graph

4054 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
f562886a7e [poincare] Fixed crash due to infinite loop with horizontal layout
Change-Id: I00106525b29ce441e10a6d88766efdecd80d8291
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
74a2211a6a [poincare] Use default methods for GCD and LCM instead of n_ary ones
Change-Id: Id353e4367bcb6700bae2f9c121af93b9379a8051
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
5b82b94c20 [poincare] Prevent forbidden ChildAtIndex call in fraction_layout
Change-Id: I00d282a6dd3618f669aaeb0202d6495ae8035f12
2020-11-04 15:11:44 +01:00
Arthur Camouseigt
edcc1f6e80 [Poincare/integral_layout.cpp] Fixed crash due to infinite loop
Changed previousNestedIntegral method to prevent integrals located in
integral bounds to be considered as nested.

Change-Id: Id8cc4369f53c278ac59039fde1c2818af2ccacab
2020-11-04 15:11:44 +01:00
Hugo Saint-Vignes
685b2a8d6d [poincare] Reduce Abs layout verticalMargin
Change-Id: I3edacc192b0274d73fd787bb81b0c895e29ddda3
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
2512425868 [poincare] Factorize bracket pair rendering
Change-Id: I80f2d04c8833352f4097bcfdcf90b5ec147dc19f
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
3aa5e8bcd6 [poincare] Add Vector Norm Layout
Change-Id: Iae5bbeabaa0ca627ae6651f187d1a42b970df37d
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
8d2af7e77f [poincare/test] Add VectorOperation tests, tidy rref tests
Change-Id: I4072bee6b2d3bf1ad17045149bff8dcdb6a2f238
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
6db02ea122 [poincare/vectors] Implement Vectors operations
Change-Id: Ib5aa2f5951f4eabe3b04078eab8b7d3a4d3769e7
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
56a9e8d74b [poincare] Fix LCM GCD bug on device compilation
Change-Id: I5ac11b7e72ede335db503b1d0f9c0be00710cd0b
2020-11-04 15:11:43 +01:00
Arthur Camouseigt
0a92499dd7 [Poincare/unit] Changing the value of AU
The value of astronomical unit was wrong. This fixes issue #1637

Change-Id: I175c8fae9044beb1e863ddbf3a260224a9c60bd6
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cce1fa0c90 [poincare/test] Add tests for LCM and GCD
Change-Id: If91c1ef863c9810e1ab87525a5ed2b4c7ed45656
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
cafb1c1c05 [poincare] LCM and GCD accept set of numbers
Change-Id: I367ff5e48fa2856e976aa020ac0d172216f3a421
2020-11-04 15:11:43 +01:00
Hugo Saint-Vignes
9e12b61849 [apps/graph] Round x before evaluating graph cursor on scroll
Change-Id: I13500669963eb8130e188a898bed0bf63655add6
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
44da25dd64 [poincare/number] Fixed typo
Change-Id: Id691ade099f09c8479582751aaab6dbd7f077711
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
891366c51d [poincare/expression_node] Added Double type
Float<float> and Float<double> used to share the same expression type
(Float), and the distinction was made by comparing their size. However,
due to padding, their size could be the same, leading to some issues :
  - On the simulator, in Calculation, type 1_mm^3 and go to the
    additional outputs. One of the results would be -0.0003081979_µm^3.

Change-Id: Ic8f9328bf462104776fbab636c34d0d152cd7e58
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
f9a1f1a1b7 [Poincare/test/approximation.cpp] Fixed broken test
Change-Id: I6d851abf9626d282133f143afa2a16ca2d8bec7e
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
b7bfc253eb [poincare/trigonometry] Modified shallowReduceInverseFunction
This fixes issues #1541. Formulas as asin(sin(X)) with X a large number
were failling to simplify themselves into the image interval of asin
ex : previous version asin(sin(6)) = 6
     new version asin(sin(6)) = -2pi+6

Change-Id: Ia6200b67914224cecd2cd943bcf9bc2ff6e0447a
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
5569ba92a2 [poincare/approximation_helper] Changed the way to approximate
To prevent incorrect approximations, such as cos(1.5707963267949) = 0, we lowered the precision value. This way,
  the approximation is more selective. However, when ploting functions such as e^(i.pi+x), the float approximation fails
  and therefore, the function appears "undef".
  As a result we created two functions Epsilon that behave differently according to the number's type. When it is a double,
  we want a maximal precision -> epsilon_double = 1x10^(-15), and when it is a float, we accept more agressive approximations
 -> epsilon_float = 10 x 1x10^(-7).

Change-Id: I844ac52ade665f51fe6888db38f4485c193286d9
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
c4018d0648 [poincare] Update rowCanonize pivot selection for more consistent ref results
Change-Id: Id7e856f57ccd3d990077b0f6753089bc6edcc03b
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
3bfc0c83d8 [poincare] Factorize Echelon Form classes
Change-Id: I7ec7290a4d94b9bd1224ad4c53be8b4662bd32d5
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
f00c135b69 [apps/calculation] Add additional outputs for matrix
Change-Id: Ia4b285eb0f28eaed838d32a1fdfb785d13664f65
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
007c38652f [poincare] Add ref and rref matrix functions
Change-Id: Id0e57a4f85d551ca5320c4b6e3c0baadae70946d
2020-11-04 15:07:20 +01:00
Arthur Camouseigt
997c103fba [Toolbox] Changed the required parameters for normal_distributions
Changed the parameter σ2 to σ. This is now consistant with the
probability app

Change-Id: I96101ba158cebef972e536cfa5cc1b2da71b543d
2020-11-04 15:07:19 +01:00
Arthur Camouseigt
6072ffd848 [poincare/normal_distribution.cpp] Fixed approximation error
Removed limitation in calculation of normal_distribution. It was used to
speed-up computation but yielded 0 for small values.
Previously P(X<5) with X->N(7,0.3162) gave 0 as a result
now it gives 1.26e-10

Change-Id: I3f1c997dfe2ba6424b372a0a82af6d9871443657
2020-11-04 15:07:19 +01:00
Hugo Saint-Vignes
969fea7494 [poincare] Improve float variables usage
Change-Id: I965c425cbe70c0a201c504565d5d0991618ce0b9
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
10de970814 [poincare] Remove unnecessary unit norm code
Change-Id: I7d7abf88d1dcc10fb4ae0f6b3570ebfe4b4af311
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
a5a57c4076 [poincare] Improve prefixes for mass and inductance unities
Change-Id: Ic9eb7b5adff7b172452b4c73bd7ddc5c59761219
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
11e41bb4dc [poincare] Add comments and alternative algorithm to beautify units
Change-Id: I4b1ce9528d9d6796fe08f8566ee5d1efafa1d87d
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
51f1cdb076 [poincare] Handle rational unit exponents
Change-Id: Id710702dbed19d34992da90978d5823d68abb80a
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
09e39ad890 [Stat+Reg] Allowing lists of values to be sorted
Change-Id: I181bb55443bf87356d127eb6c56ff6140806fdea
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
082f9819e9 [Poincare] Changed ConvertFloatToText to prevent conversion error
We now compute the value of the mantissa in double (instead of float)
to limit conversion error occuring for big numbers.

Change-Id: Ia61c052f0bc4a9196c53e2c7900eb48e3343d39c
2020-11-04 14:45:35 +01:00
Arthur
6380bf7885 [poincare/integral_layout] Changing the integral layout and behavior
Should there be multiple integrals in a row,
they now all have the same height.

Change-Id: I106c4e2cb2671f6518f1d916f414f6e9349f83dc
2020-11-04 14:45:35 +01:00
Arthur
02af868274 [poincare/sum_layout.cpp] Modified the look of the sigma symbol
Change-Id: Ib79414eed96aedacc51b89dce22a14a4e7891cdf
2020-11-04 14:45:35 +01:00
Arthur
bd74ab9718 [poincare/sequence_layout] Modified the height of sigma and product signs
Because of their previous even height, those symbols were not aligned with fractions. Now that they have an uneven size, they line up correctly.
2020-11-04 14:45:35 +01:00
Arthur
45db7f1d48 [poincare/integral_layout.cpp] Reduced the gap between integral sign and integrand
The gap between the integral sign and the integrand has been reduced. It looks more natural this way.
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
92f56445fe [poincare/sum_layout] Modified the way to draw sigma
New way of drawing sigma sign. Only a single branch is stored. The full
symbol is created by mirroring half a symbol.

Change-Id: I0fc32393203e51578c88b01125a907d402291534
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
1e0449791d [poincare/integral_layout] Changing the integral symbol
Changed the look of the integral symbol and the positions of the upper
and lower bounds. Added a drawing of the window to explain the meaning
of various margins.

Change-Id: I3ffc07848dc9ad68dce3c0e01853d548e31dd152
2020-11-04 14:45:35 +01:00
Arthur Camouseigt
653b7d0ac4 [poincare] Bigger product and sum signs
Replacing the product and sum signs with bigger and antialiased ones.
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
abb662b606 [poincare/test] Added tests on fraction layouts
Change-Id: I351d707c03b96c93e090e2e74c1841ebe9d7a691
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
4ca4d4f45e [poincare/layout] Factored Parenthesis collapsing
Parenthesis collapsing is no longer handled by LeftParenthesisLayout and
RightParenthesisLayout, but by ParenthesisLayout itself.

Change-Id: I6797cd40ee02881544e01e9b88f31a597c51d179
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
e2e062e128 [poincare/layout] Changed Fraction collapsing
Fraction are now only collapsed if they are the first thing to be
collapsed or if a parenthesis is open.

Change-Id: Ie7f3a99498b9981dff70221efd7de6bee6d0c379
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
9527894b25 [poincare] Function LayoutFromAddress
Created function Layout::LayoutFromAddress, which creates in the pool a layout
that has been stored in a buffer. Functionally identical to
Expression::ExpressionFromAddress.

Change-Id: I204e6b7d42f259ef2732563aa2a168a644060867
2020-11-04 14:45:35 +01:00
Hugo Saint-Vignes
3db1cad18b [poincare] Move IsApproximatelyEqual to a better helper
Change-Id: I056a96b3721005e01c6ef3f166a80a08195ff338
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
735fc6e1bb [poincare] Generalize Binomial Coefficient n to any real
Change-Id: I3cda882e67db4becfe232c6428e14905e922662b
2020-11-04 14:45:34 +01:00
Hugo Saint-Vignes
70cd166da5 [escher] Scroll speed increase for long repetition in layout fields
Change-Id: I9460cb44631f0b225598804334da5a0e74029915
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
78a1350f15 [poincare/test/derivative.cpp] Added context-aware tests.
New tests compute derivatives while replacing symbols with their definitions or undefined, as the device does.

Change-Id: I99179bf6540182ff929938fb96a00a1ed2fbcf49
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
a9c94236c2 [poincare] Implemented further derivation methods and updated tests.
Derivation now works on tangents and the three hyperbolic functions.

Change-Id: I62049e79c661c3c4a031be0a93c403fb936d611b
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
eab8167a56 [poicare/logarithm] Implemented didDerivate and unaryFunctionDifferential for Logarithm
Derivation now computes as expected on logarithms, as long as their base is not a function of the derivation variable.

Change-Id: Ia56da1c1151c0ddf3887be84ddb4bd02664c5188
2020-11-04 14:45:34 +01:00