Start doc on polynoms

This commit is contained in:
Lafrite 2015-02-21 11:27:02 +01:00
parent b508a8afb4
commit 3a721ce1b3

View File

@ -14,3 +14,42 @@
>>> print(P) >>> print(P)
5 x^{ 2 } + 4 x - 7 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