MATLAB: How to incorporate positive and negative theta while plotting graph for Range vs theta in projectile motion

projectileprojectile motion

I am trying to write a code to plot a graph for Range vs theta for projectile motion and using it in LABVIEW. I don't know how to incorporate θ as positive and negative when above and below the horizontal. Below is the code I have written for LABVIEW's MATLAB script
v
g = 9.8
H
V = v.*v
G = 2.*g
theta = linspace(0,90,91)
a = 2.*theta
b = sin(a)
c = b.*b
d = V/G
e = 8.*g.*H /V
A = sqrt((sin(a)).^2+e.*(cos(theta)).^2)
R = d.*[a+A]

Best Answer

linspace can take negative values, you know.
My projectile demo is attached.