repo.or.cz
/
sympy.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Welcome to SymPy (Alan Bromborsky)
[sympy.git]
/
examples
/
vandermonde.py
blob
201ed7d7eb112a430a7e93594a9fc135831aecd2
1
#!/usr/bin/env python
2
import
iam_sympy_example
3
4
from
sympy
import
sqrt
,
symbols
,
eye
5
6
w
,
x
,
y
,
z
=
symbols
(
"wxyz"
)
7
L
= [
x
,
y
,
z
]
8
V
=
eye
(
len
(
L
))
9
for
i
in
range
(
len
(
L
)):
10
for
j
in
range
(
len
(
L
)):
11
V
[
i
,
j
] =
L
[
i
]**
j
12
det
=
1
13
for
i
in
range
(
len
(
L
)):
14
det
*=
L
[
i
]-
L
[
i
-
1
]
15
16
print
"matrix"
17
print
V
18
print
"det:"
19
print
V
.
det
().
expand
()
20
print
"correct result"
21
print
det
22
print
det
.
expand
()