Professional Documents
Culture Documents
Math16-1L / A3
Submitted by:
a) Title:
PROJECTILE CALCULATOR
b) Topic:
Trigonometric Identities
c) Significance:
This project will be a significant help in calculating where the maximum height and range
of a thrown object or a projectile, as well as its time of flight. This project could be also
beneficial for students in their physics subject, specifically Phy10, when they are solving
projectile motion related problems. Moreover, this project will provide outcomes of given
values using the same algorithm, avoiding human errors in between.
d) Applications:
Basic problems regarding projectile motion like throwing a ball and calculating how far
it can go or how high it can be or a motorcycle stunt person travels at a certain speed
and jumps off a ramp at a certain angle to the horizontal are where the projects function
may be applicable.
e) Source Code:
//clean the slate
clear;
clc;
disp("Final Project for Math16L")
disp("Trajectory Calculator")
disp("Welcome!! This program calculates the maximum range, maximum height, and the
time of flight of any object thrown, given that the initial velocity and the angle is input.")
disp("This program can be used by students for checking their solutions for their physics
subjects, or anyone else to predict where something will land.")
// This part asks for the necessary inputs like the initial velocity and angle from the user
r = 1; //r as in repeater. This integer controls our looping statements
while r == 1 do
disp("What is the angle in degrees of the projectile when it was launched? It should be
greater than or equal to 0 and less than or equal to 90 degrees")
angle = input("");
if angle > 90 | angle<0 then
disp("Wrong Input. Please try again.")
r=1
else
r=0
end
end
while r == 0 do
disp(" Is the initial velocity of the projectile known? Enter 0 if yes, 1 if no")
q = input("")
if q == 0
v = input("Please enter initial velocity in meters per second: ")
r=1
elseif q == 1
disp("Please do a test fire at 0 degrees. At what height in meters was it launched?")
h = input("")
disp("How far did the projectile go?")
l = input("")
//The following two equations calculate for the time then velocity respectively. The
9.8 is taken from the gravitational constant of the earth
t = sqrt(h / 9.8) //This one calculates time
v=l/t
//This one the velocity
disp("Your initial velocity in meters per second is ")
disp(v)
r=1
else
disp("Wrong Input, please try again.")
r = 0;
end
end
while r == 1 do //recycling again
disp("Is the launcher on a raised platform? If yes, enter 0, if not type 1")
q = input("")
if q == 0
disp("Please input the height in meters of the launcher.")
height = input("")
r=0
elseif q == 1
height = 0
r = 0;
else
disp("Wrong Input, please try again.")
r=1
end
end
disp("All required inputs are in order.Type resume to continue")
pause;//for effect
r=0
else
disp("Wrong input")
r=0
end
disp("Want to graph another one? Input 0 for yes, 1 for no")
r = input("")
end
f) Scope and Limitations:
This project mainly computes for the maximum possible height and range of a projectile,
as well as its time of flight, given the angle it was launched from and its velocityneglecting air resistance. If the velocity cannot be provided, an alternative is provided.
The alternative would require conducting a small test- launching the projectile
horizontally, taking the height it was launched from and how far it went, and the project
would calculate the velocity from that alternative.
g) Screen Shots:
h) Manual Solutions:
Given: Angle = 45
(Initial velocity is unknown)
Height of the launcher = 0.1 meters
Length of the drop of projectile = 0.1 meters
t=
0.1 m
9.8 meters per secon d 2
t=0.1010152545
v=
0.1 m
0.1010152545 s
v =0.9899494937 m/ s
Time of flight
t=
2 v
9.8 meters per second
t=
2 0.98995
9.8 meters per second
t=0.1428572159
Max Range
x=0.1 m
Max Height Reached
1 t
y=v t sin angle g
2 2
()
1
0.143
y=0.99 0.143 sin 45 ( 9.8 )
2
2
y=0.075 m