Interpolation over trajectory at set positions on path

323 Views Asked by At

I have the following:

  • 2d vector for velocity
  • 2d start coordinate
  • gravity acceleration

I need to know the coordinate of a projectile at a given distance along the trajectory.

For example:

  • Velocity = (5m/s,3m/s)
  • start coordinate = (10m,10m)
  • gravity = 10m/s/s
  • distance along trajectory from start = 1m

I'm doing this for a simulation where I need to draw a dotted line along a trajectory of a projectile.

1

There are 1 best solutions below

3
On BEST ANSWER

Taking $y$ as the vertical, measured up, and $x$ as horizontal, we have $x(t)=x_0+v_x(0)t, y(t)=y_0+v_y(0)t-\frac{g}{2}t^2$

Added: the arclength element is $ds=\sqrt{dx^2+dy^2}$ so $\frac{ds}{dt}=\sqrt{(\frac{dx}{dt})^2+(\frac{dy}{dt})^2}=\sqrt{v_x^2+(v_y(0)-gt)^2}$ It may be easier to integrate the differential equation, particularly if something may perturb the trajectory along the path.