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
disable git when .git does not exist
[liba.git]
/
python
/
test
/
trajbell.py
blob
318c14a8e2e650a6674f53787a0629130c87c05c
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
traj
=
liba
.
trajbell
()
11
traj
.
gen
(
3
,
2
,
3
,
0
,
10
)
12
13
N
=
1000
14
x
= [
0.0
] *
N
15
T
=
traj
.
t
/
N
16
for
i
in
range
(
N
):
17
x
[
i
] =
i
*
T
18
19
p
=
traj
.
pos
(
x
)
20
v
=
traj
.
vel
(
x
)
21
a
=
traj
.
acc
(
x
)
22
j
=
traj
.
jer
(
x
)
23
24
for
i
in
range
(
N
):
25
print
(
"
%g
,
%g
,
%g
,
%g
,
%g
"
% (
x
[
i
],
p
[
i
],
v
[
i
],
a
[
i
],
j
[
i
]))
26
27
traj
.
t
28
traj
.
tv
29
traj
.
ta
30
traj
.
td
31
traj
.
taj
32
traj
.
tdj
33
traj
.
p0
34
traj
.
p1
35
traj
.
v0
36
traj
.
v1
37
traj
.
vm
38
traj
.
jm
39
traj
.
am
40
traj
.
dm