repo.or.cz
/
liba.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
support for some unittests in CMake
[liba.git]
/
python
/
test
/
trajpoly3.py
blob
8e85fa94cbcb401ad2c603bd046734d87316b492
1
#!/usr/bin/env python
2
import
os
,
sys
3
4
sys
.
path
.
insert
(
0
,
os
.
getcwd
())
5
if
len
(
sys
.
argv
) >
1
:
6
sys
.
stdout
=
open
(
sys
.
argv
[
1
],
"w"
)
7
8
import
liba
# type: ignore
9
10
t
= (
0
,
1
)
11
p
= (
0
,
1
)
12
v
= (
0
,
1
)
13
traj
=
liba
.
trajpoly3
(
t
[
1
] -
t
[
0
],
p
[
0
],
p
[
1
],
v
[
0
],
v
[
1
])
14
15
N
=
1000
16
x
= [
0.0
] *
N
17
T
= (
t
[
1
] -
t
[
0
]) /
N
18
for
i
in
range
(
N
):
19
x
[
i
] =
i
*
T
20
21
p
=
traj
.
pos
(
x
)
22
v
=
traj
.
vel
(
x
)
23
a
=
traj
.
acc
(
x
)
24
25
for
i
in
range
(
N
):
26
print
(
"
%g
,
%g
,
%g
,
%g
"
% (
x
[
i
],
p
[
i
],
v
[
i
],
a
[
i
]))
27
28
traj
.
p
29
traj
.
v
30
traj
.
a