projectile_drag.m 227 B

12345
  1. function [pos_x, pos_y] = projectile_drag(v0, theta, b, m, t)
  2. g = 9.81; %m/s^2
  3. pos_x = ((m*v0*cos(theta))/b) * (1 - exp(-(b/m) * t));
  4. pos_y = (m/b) * (v0*sin(theta)+((m*g)/b)) * (1-exp(-(b/m)*t)) - ((m*g*t)/b);
  5. end