function [yMax,xMax,tof] = projectileKin(vo,theta) %[yMax,xMax,tof] = projectileKin(vo,theta); % function to calculate range, height and time-of-flight for a simple % projectile %(PHYS 220 HW #1, problem 2, Spring 2009) % % vo --> initial speed (muzzle velocity, m/s) % theta --> initial angle (degrees) % yMax <== max. height (m) % xMax <== range (m) % tof <== time-of-flight (s) % this constant is hardwired g = -9.81; yMax = -(vo*sind(theta))^2 / (2*g); xMax = -vo^2 * sind(2*theta) / g; tof = -2*vo*sind(theta) / g; return