Skip to content
Snippets Groups Projects
Commit 3a195b6e authored by Anton Kullberg's avatar Anton Kullberg
Browse files

py: added exercise 2 trajectories

parent a8370789
No related branches found
No related tags found
No related merge requests found
......@@ -22,3 +22,22 @@ def get_ex1_trajectories():
# Trajectory 4
T4 = np.concatenate([T1, T2[:, 1:], T3[:, 1:]], axis=1)
return dict(T1=T1, T2=T2, T3=T3, T4=T4)
def get_ex2_trajectories():
T = get_ex1_trajectories()
v = 100/3.6
p0 = np.array([200, 1200])
pT = p0+2000*np.array([np.cos(-np.pi/6), np.sin(-np.pi/6)])
N = int(2000/v)
px5 = np.linspace(p0[0], pT[0], N)
py5 = np.linspace(p0[1], pT[1], N)
T5 = np.vstack([px5, py5])
p0 = np.array([1500, 1800])
pT = np.array([1500, 800])
N = int(2000/v)
px6 = np.linspace(p0[0], pT[0], N)
py6 = np.linspace(p0[1], pT[1], N)
T6 = np.vstack([px6, py6])
T.update(dict(T5=T5, T6=T6))
return T
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment