Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
function [ height ] = darts( v_initial,angle )
%Dart Projectile Calculator
% Calculate the hight at which a projectile will land
% when thrown at a specific velocity and angle
r_angle = angle*(pi/180); % angle converted to radians
Vy = v_initial.*sin(r_angle); % x component of velocity
Vx = v_initial.*cos(r_angle); % y component of velocity
time = (2*v_initial*sin(r_angle))/9.81;
h = (Vy*time) - (.5*(9.81)*(time)^2) + 1.72;
height = h;
fprintf('Your height is %f\n',height) %Display of Results
time_int = 0:0.01:time; %Define time interval in vector form (still seconds)
X_Range = Vx*time_int; %Define x distance as vector
Y_Range = 1.72+Vy*sin(r_angle)*time_int-(1/2)*9.81*time_int.^2; %Define y distance as vector
setdefaults %Setting the defaults
plot(X_Range,Y_Range); %Plotting the points, x and y are both dependent on time_interval
xlabel('Distance (meters)');
ylabel('Distance (meters)');
title('Dart Throwing Graph');
end