create a_linalg_dot
[liba.git] / python / test / trajpoly7.py
blobe58824d8ca88f2869befd82769af340e6e996c70
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 t = (0, 1)
14 p = (0, 1)
15 v = (0, 1)
16 traj = liba.trajpoly7(t[1] - t[0], p[0], p[1], v[0], v[1])
18 N = 1000
19 T = (t[1] - t[0]) / N
20 x = liba.new_float(N)
21 for i in range(N):
22 x[i] = i * T
24 p = traj.pos(x)
25 v = traj.vel(x)
26 a = traj.acc(x)
27 j = traj.jer(x)
29 for i in range(N):
30 print("%g,%g,%g,%g,%g" % (x[i], p[i], v[i], a[i], j[i]))
32 traj.p
33 traj.v
34 traj.a
35 traj.j