The formula for the trajectory of a ball is given by f(x)=xtanθ−12v20gx2cos2θ+y0 where x is a coordinate along the ground, g=9.81 is the acceleration due to gravity, v0 is the magnitude of the initial velocity which makes an angle θ with the x-axis, and (0,y0) is the initial position of the ball. Write a program to calculate the trajectory y=f(x) for 0≤x≤16, with y0=10, v0=10, θ=50∘. (Do Python trigonometric functions accept radians or degrees?) Let x vary between 0 and 16 with 101 points. You will need to:

Respuesta :

Answer:

The program in python is as follows:

import math

def traj ect ory(th e ta,x,y,v):

   t = ma th . tan(m ath . radians(theta))

   c = math . cos(math . radians(theta))

   g = 9 . 8

   fx = x * t - (1/(2*v**2)) * ((g*x**2)/(c**2))+y

   return round(fx,3)

   

print("x\t f(x)")

for x in range(0,17):

   theta = 50

   y= 10

   v = 10

   print(str(x)+"\t"+str(tr aje ctory (the ta,x,y,v)))

Explanation:

The question is incomplete. However, I have written the program to calculate the trajectory values f(x).

See attachment for complete program where comments were used as explanation

Ver imagen MrRoyal