release 0.1.15
[liba.git] / python / test / trajbell.py
blobf46ab4f6199f22968c990ac4a70704b28cba3f38
1 #!/usr/bin/env python
2 from __future__ import print_function
3 import os, sys
5 path = os.path.dirname(__file__)
6 path = os.path.dirname(path)
7 sys.path.insert(0, path)
8 if len(sys.argv) > 1:
9 sys.stdout = open(sys.argv[1], "w")
11 import liba # type: ignore
13 traj = liba.trajbell()
14 traj.gen(3, 2, 3, 0, 10)
16 N = 1000
17 T = traj.t / N
18 x = liba.new_num(N)
19 for i in range(N):
20 x[i] = i * T
22 p = traj.pos(x)
23 v = traj.vel(x)
24 a = traj.acc(x)
25 j = traj.jer(x)
27 for i in range(N):
28 print("%g,%g,%g,%g,%g" % (x[i], p[i], v[i], a[i], j[i]))
30 traj.t
31 traj.tv
32 traj.ta
33 traj.td
34 traj.taj
35 traj.tdj
36 traj.p0
37 traj.p1
38 traj.v0
39 traj.v1
40 traj.vm
41 traj.jm
42 traj.am
43 traj.dm