'''
Python program to calculate the horizontal_distance for given initial velocity,
launch angle and altitude changes in the landing position
'''
import math
def horizontal_distance(v, theta, del_h):
""" (num,num,num) -> (num)
This function receives initial velocity, launch angle , and altitude changes
in the landing position and returns the horizontal range of the projectile
v is in [m/s]
theta is in [degrees]
del_h is in [m]
"""
g = 9.81
# math.radians(angle) - convert the degree to radians
range = v*math.cos(math.radians(theta))*(((v*math.sin(math.radians(theta)))/g) + math.sqrt((((v**2)*(math.sin(math.radians(theta))**2))/(g**2)) - ((2*del_h)/g)))
return range
velocity = 100
angle = 20
delta_h = 40
range = horizontal_distance(velocity, angle, delta_h)
print("\nThe range is : "+str(range))
#end of program
Code Screenshot:
Output:
can someone write me a wing101 python code for this please Question: For a projectile launched with a velocity vIm/s) at an angle to the horizontal 6 Iradl, the horizontal distance travelled (al...
Question: Write a python code to calculate the range (max horizontal distance), maximum height, time in the air of a projectile. You input the launch angle and the initial velocity of the projectile into the program. The only acceleration on the object is due to gravity. units: meters, seconds
Could somebody help me with this question for the coding on MATLAB? Thank you Projectile Motion The distance a projectile travels when fired at an angle Θ is a function of time and can be divided into horizontal distance, dVotcos(O) and the vertical distance is dy Vot sin(0)-0.5gt2. Suppose a projectile is fired at an initial velocity of 100 m/s and a launch angle of /4 radians (45°). Use ezplot to graph horizontal distance on the x -axis and vertical...
EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal direction and with an initial speed of 10 m/s. s0 (A) How do the vertical and horizontal components of the projectile's velocity vary with time? 40 35 (B) How long does it remain in flight? 25 (C) For a given launch speed, what launch angle produces the longest time of flight? 15 10 toy CONCEPTUALIZE Consider the projectile to be a point mass that...
Please help me correct my MATLAB script code for this problem, thank you!! A projectile PA is launched from point A towards the east with an initial launch velocity voa and an initial lauw angle of 0x. The impact point of the projectile Pa is a point B in a valley with an ordinate, yon, located below the clevation of point A. The launch from point A is instantaneously detected at point B, and a counter projectile P launched simultaneously...
1 2 A projectile PA is launched from point A towards the east with an initial launch velocity ves and an initial launch angle of 8aA. The impact point of the projectile Pa is a point B in a valley with an ordinate, you, located below the elevation of point A. The launch from point A is instantaneously detected at point B, and a counter projectile Pa ts launched simultaneously towards the west to intercept the incoming projectile PA. Projectile...
Please help me with no 48 a. What is the wheel's angular velocity, in rpm, 10 s later? b. How many revolutions does the wheel make during this time? an e 43. Starting from rest, a DVD steadily accelerates to 500 rpm in 1.0s, rotates at this angular speed for 3.0 s, then steadily deceler- ates to a halt in 2.0s. How many revolutions does it make? ie y Problems 44.l A spaceship maneuvering near Planet Zeta is located at...
I want the math lab code for theses problems in a unique way Theory A projectile is launched from point A up an incline plane that makes an angle of 10 with the horizontal. The mountain is 6,000 m high. Vo 10° Figure 1: Flightpath of a projectile. If we neglect the air resistance, the flight path of a projectile launched at an initial speed vo and an angle θ of departure relative to the horizontal is a parabola (see...
Please can someone help me to finish this program? It is a C programming not a C++, when programming the program in linux I keep getting expected expression before || token, also please check if everything else is fine, maybe there is something else worng in my program and may ask me later to fix it, I am concern about the sin and cosine. The program is supposed to do all this: 1.Display a welcome message. 2.Prompt for the height...
can you answer both #1 (a&B) and #2 please 1. Write MATLAB code to do the following: (4 pts) a) Find the area of the circles where r=[7, 8, 10] using A = tr2 b) Find the distance traveled by a ball falling in the air is given by the equation x=x0+vot+ at?. Calculate the position of the ball at time t = 5s, XO = 10m, vo= 15 m/s, and a = 9.81 m/sec^2. Write MATLAB code to accomplish...
can someone please help me write a python code for this urgently, asap Question: Write a Python function, minmp, that is passed a file name and a metal alloy's formula unit structure*". The file will contain metal elements and their properties. The function will return a tuple of the element from the formula with the lowest melting point and that melting point Write a second function, molform, that will be called by the first function, to take the metal alloy's...