I have the coordinates of say 10 points at different time levels and I wish to join those coordinates to make it look like a trajectory?
def euler_method(points, x_dot, y_dot, x1, x2, time_step, n_steps):
n_points = len(points[:, 0])
point_trajectory = np.zeros((n_points, 2, n_steps))
for i in range(0, n_steps):
point_trajectory[:, :, i] = points
f1 = sp.lambdify((x1, x2), x_dot, "numpy")
f2 = sp.lambdify((x1, x2), y_dot, "numpy")
u = f1(points[:, [0]], points[:, [1]])
v = f2(points[:, [0]], points[:, [1]])
points_new_x = points[:, [0]] + u*time_step
points_new_y = points[:, [1]] + v*time_step
points = np.hstack((points_new_x, points_new_y))
return point_trajectory
def plot_trajectory(points_at_diff_time) - Is what I want to create
I am not able to think how to represent it. Please suggest how to do it, preferably in matplotlib.
EDIT: Something like this - moving points with different coordinates at different times.