remove redundant includes
[liba.git] / python / test / trajtrap.py
blob026e99a210c0b406147986b2e22f9a67b90f6ff0
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.trajtrap()
13 traj.gen(2, 2, -2, 0, 4)
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)
25 for i in range(N):
26 print("%g,%g,%g,%g" % (x[i], p[i], v[i], a[i]))
28 traj.t
29 traj.p0
30 traj.p1
31 traj.v0
32 traj.v1
33 traj.vc
34 traj.ta
35 traj.td
36 traj.pa
37 traj.pd
38 traj.ac
39 traj.de