Émilie Feral
f714699575
[poincare] Clean Expression::CreateComplexExpression
2019-01-10 11:42:03 +01:00
Émilie Feral
9efc9e02e6
[poincare] Revert simplifyForComplexFormat
2019-01-10 11:42:03 +01:00
Émilie Feral
2fe8b386c3
[poincare] Add tests on Complex
2019-01-10 11:42:03 +01:00
Émilie Feral
2e89f8b7de
[poincare] Expression::simplifyForComplexFormat: Use a shortcut if the expression approximation is a real pure
2019-01-10 11:42:03 +01:00
Émilie Feral
7d9c49919c
[poincare] simplifyForComplexFormat: before extracting
...
ComplexCartesian/ComplexPolar, deepReduce instead of simplify to avoid
generating uselessly big trees. To make it work, implement shortcuts for
Power::complexCartesian and Power::complexPolar to return nice cartesian
expression when the power index is -1, 1/2 or -1/2
2019-01-10 11:42:03 +01:00
Émilie Feral
c62922ec5c
[poincare] Change complex getters design: extract real and imaginary
...
parts at the same time in complexCartesian and norm and arg in
complexPolar
2019-01-10 11:42:03 +01:00
Émilie Feral
91163ae6f5
[poincare] Improve complexSquareNorm thanks to sign
2019-01-10 11:42:03 +01:00
Émilie Feral
64aebcf16d
[poincare] Implement shallowReduce of ComplexArgument, AbsoluteValue,
...
RealPart and ImaginaryPart
2019-01-10 11:42:03 +01:00
Émilie Feral
2f8ede54f2
[poincare] The sign function was used to decide wether an expression was
...
of form -x. However, ln(0.3) has a negative sign but is not of form -x.
This commit fixes the misuse of ExpressionNode::Sign::negative.
For example, we do not turn sin(tan(9)) in -sin(-tan(9)) or
arcsin(sin(12)) in -arcsin(-sin(12) because tan(9)<0 and sin(12)<0
2019-01-10 11:42:03 +01:00
Émilie Feral
9e2b709fcb
[poincare] Change sign() signature to sign(context, angleUnit)
2019-01-10 11:42:03 +01:00
Émilie Feral
cc83fec322
[poincare} Power::complexPolarPart: avoid an extra shallowReduce by
...
inserting *(-1) instead of an OppositeNode
2019-01-10 11:42:03 +01:00
Émilie Feral
be741415b0
[poincare] Fix comment
2019-01-10 11:42:03 +01:00
Émilie Feral
8f63416097
[calculation] Fix Calculation operator ==
2019-01-10 11:42:03 +01:00
Émilie Feral
f8251a74bc
[poincare] SquareRoot: use realPart and imaginaryPart to compute the
...
complexArgument
2019-01-10 11:42:03 +01:00
Émilie Feral
68367343ed
[poincare] Add tests on complex extractors
2019-01-10 11:42:03 +01:00
Émilie Feral
466efc1dbd
[poincare] Trigonometry: speed up the look up in the cheat table
2019-01-10 11:42:03 +01:00
Émilie Feral
d72b906919
[poincare] SquareRoot: implement realPart & imaginaryPart
2019-01-10 11:42:03 +01:00
Émilie Feral
ee0d158bd9
[poincare] Add rules on cos(arcsin), cos(arctan), sin(arccos),
...
sin(arctan), tan(arccos), tan(arcsin)
2019-01-10 11:42:03 +01:00
Émilie Feral
a13246fca1
[poincare] simplifyForComplexFormat: simplify instead of reducing before extracting
...
real and imaginary parts
2019-01-10 11:42:03 +01:00
Émilie Feral
5dae60bc7e
[poincare] Complex parts getters (realPart, imaginaryPart,
...
complexNorm...) simplify while building the complex part
2019-01-10 11:42:03 +01:00
Émilie Feral
79e7fb2183
[calculation] Use ParseAndSimplifyForComplexFormat instead of
...
ParseAndSimplify
2019-01-10 11:42:03 +01:00
Émilie Feral
56c8e8b704
[poincare] Expression: create method ParseAndSimplifyForComplexFormat
2019-01-10 11:42:03 +01:00
Émilie Feral
f452d8fced
[poincare] Fatorize code of Complex::complexToExpression in
...
Expression::CreateComplexExpression that create the expression a+i*b or
r*e^(i*th) from 2 expressions representing a & b or r & th.
2019-01-10 11:42:03 +01:00
Émilie Feral
476a79565f
[poincare] Number::setSign does not need a context or angleUnit
2019-01-10 11:42:03 +01:00
Émilie Feral
fe6a5af47b
[poincare] Change Expression::setSign signature
2019-01-10 11:42:03 +01:00
Émilie Feral
3c3f68c6c4
[poincare] Multiplication and Division implement realPart,
...
imaginaryPart and complexNorm
2019-01-10 11:42:03 +01:00
Émilie Feral
d95585956c
[poincare] Implement Expression::realPart, Expression::imaginaryPart,
...
Expression::complexNorm, Expression::complexArgument
2019-01-10 11:42:03 +01:00
Émilie Feral
0e1825817b
[poincare] Test: clean helper
...
Create a method expressions_are_equal
2019-01-10 11:42:02 +01:00
Émilie Feral
0c1e76c9c5
[poincare] Expression: add methods to get complex parts of expression
2019-01-10 11:42:02 +01:00
Émilie Feral
f8f3652687
[poincare] Expression: add radianToDegree and degreeToRadian methods
2019-01-10 11:42:02 +01:00
Émilie Feral
88a2751e6b
[poincare] Add SignFunction class
2019-01-10 11:42:02 +01:00
Émilie Feral
c4ce3c28e1
[poincare] Factorial::sign is always positive
2019-01-10 11:42:02 +01:00
Léa Saviot
fd34e83a56
[apps] In curve views, display floating labels when axes non visible
2019-01-10 11:42:02 +01:00
Léa Saviot
fa24a4fd54
[apps] Put the Y labels left of the Y axis
2019-01-10 11:42:02 +01:00
Léa Saviot
6b381957df
[apps] Handle cut labels in curves.
...
Draw all labels even if cut. If only the extrema horizontal labels are
drawn, pick the labels 1 and numberOfLabels-2 if the real extrema labels
will be cut.
2019-01-10 11:42:02 +01:00
Léa Saviot
9ac32cf8fe
[apps] Use standard variables in curve view
2019-01-10 11:42:02 +01:00
Léa Saviot
d40b17a45e
[apps] In curve view, draw the graduation even if the label is not drawn
2019-01-10 11:42:02 +01:00
Léa Saviot
c14483b0e7
[apps/shared] Clean some code in CurveViewRange
2019-01-10 11:42:02 +01:00
Léa Saviot
8c6ffa6d42
[apps] Fix graph X axis labels that read the same
...
Scenario: just zoom in in a graph
Fix:
- Do not truncate labels.
- Label size is computed depending on available size and number of
labels.
- If labels cannot be displayed properly, just display the minimal
and maximal labels!
2019-01-10 11:42:02 +01:00
Léa Saviot
48bccac8de
[apps/probability] Clean class NormalLaw
2019-01-10 11:42:02 +01:00
Léa Saviot
86409c771a
[poincare/expression] Add escape case on uninitialized expression
2019-01-10 11:42:02 +01:00
Léa Saviot
f62249c8ac
[poincare] Try to reduce the number of digits in print float
...
We did not take into account the zeros ending the mantissa when
computing a smaller required length.
2019-01-10 11:42:02 +01:00
Léa Saviot
f2310a8814
[apps] Change CurveViewRange::computeGridUnit parameters
2019-01-10 11:42:02 +01:00
Léa Saviot
2aa92ecffa
[apps] Add a proof for CurveViewRange::computeGridUnit's algorithm
2019-01-10 11:42:02 +01:00
Léa Saviot
78c277b159
Fix comment typo
2019-01-10 11:42:02 +01:00
Léa Saviot
a65bdb1dfc
[apps] Increase the Y axis label buffer sizes in curve views
2019-01-10 11:42:02 +01:00
Léa Saviot
d76c77f323
[apps] Prevent too much zooming on curve views
...
This removes curve drawings that are ugly because of float imprecision,
such as cos(x)^2+sin(x)^2
2019-01-10 11:42:02 +01:00
Léa Saviot
36faebab3d
[apps] Fix some KDCoordinate to float conversions
2019-01-10 11:42:02 +01:00
Léa Saviot
8de74f4158
[apps] Fix one pixel in CurveView::stampAtLocation
2019-01-10 11:42:02 +01:00
Léa Saviot
4c6a5c9819
[apps] When zooming on a curve, do not change the yRange
...
It changed because of the zoom banner
2019-01-10 11:42:02 +01:00