remove redundant includes
[liba.git] / python / test / trajpoly7.py
blobce60760be632ddccb9effaf6aad9d5fc9de2beb3
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 t = (0, 1)
13 p = (0, 1)
14 v = (0, 1)
15 traj = liba.trajpoly7(t[1] - t[0], p[0], p[1], v[0], v[1])
17 N = 1000
18 x = [0.0] * N
19 T = (t[1] - t[0]) / N
20 for i in range(N):
21 x[i] = i * T
23 p = traj.pos(x)
24 v = traj.vel(x)
25 a = traj.acc(x)
26 j = traj.jer(x)
28 for i in range(N):
29 print("%g,%g,%g,%g,%g" % (x[i], p[i], v[i], a[i], j[i]))
31 traj.p
32 traj.v
33 traj.a
34 traj.j