From: uzair on
hello,
i'm trying to make a bowman game in 2D in Matlab where the bowman fires a bow and it moves in a parabolic path. The problem I'm facing is how to change the direction of the arrow at each instant so that the arrow moves in a semicircular path.
Any help will be appreciated.
Thank you
From: ImageAnalyst on
Pick some length for the arrow, and the slope of the arrow at any
given x is just the derivative of your parabola function. Just
standard calculus or pre-calculus. E.g. y = a0 + a1*x + a2*x.^2, so
slope = a1 + a2 * x.

So you know the center and two end points (from the point-slope
formula for a line) so you can then use line() to plot it.