diff --git a/docs/polynom.mdwn b/docs/polynom.mdwn index c3007e9..a265841 100644 --- a/docs/polynom.mdwn +++ b/docs/polynom.mdwn @@ -14,3 +14,42 @@ >>> print(P) 5 x^{ 2 } + 4 x - 7 +## Manipuler des polynômes + +### Les représentations des polynômes + + >>> P = Polynom([1, 2, 3]) + >>> print(P) + +### Évaluer des polynômes + + >>> type(P(3)) + pymath.expression.Expression + >>> for i in P(3).simplify(): + print(i) + 3 \times 3^{ 2 } + 2 \times 3 + 1 + 3 \times 9 + 6 + 1 + 27 + 6 + 1 + 33 + 1 + 34 + >>> P(3).simplified() + 34 + + +### Opération et polynômes + + >>> type(P + 1) + list + >>> for i in (P+1): + print(i) + 3 x^{ 2 } + 2 x + 1 + 1 + 3 x^{ 2 } + 2 x + 1 + 1 + 3 x^{ 2 } + 2 x + 2 + >>> Q = Polynom([4, 5, 6]) + >>> for i in (P+Q): + print(i) + 3 x ^ 2 + 6 x ^ 2 + 2 x + 5 x + 1 + 4 + ( 3 + 6 ) x ^ 2 + ( 2 + 5 ) x + 1 + 4 + 9 x ^ 2 + 7 x + 5 + +