update options for pip installation in README.md
[liba.git] / python / test / trajbell.py
blob45a06863b54e02e512e0f4bfc33aa925db039fa0
1 #!/usr/bin/env python
2 import os, sys
4 base = os.path.dirname(__file__)
5 path = os.path.dirname(base)
6 sys.path.insert(0, path)
7 if len(sys.argv) > 1:
8 sys.stdout = open(sys.argv[1], "w")
10 import liba # type: ignore
12 traj = liba.trajbell()
13 traj.gen(3, 2, 3, 0, 10)
15 N = 1000
16 x = [0.0] * N
17 T = traj.t / N
18 for i in range(N):
19 x[i] = i * T
21 p = traj.pos(x)
22 v = traj.vel(x)
23 a = traj.acc(x)
24 j = traj.jer(x)
26 for i in range(N):
27 print("%g,%g,%g,%g,%g" % (x[i], p[i], v[i], a[i], j[i]))
29 traj.t
30 traj.tv
31 traj.ta
32 traj.td
33 traj.taj
34 traj.tdj
35 traj.p0
36 traj.p1
37 traj.v0
38 traj.v1
39 traj.vm
40 traj.jm
41 traj.am
42 traj.dm