Skip to content
Advertisement

the graphs of the two projectiles does not work properly when complementary angles(eg 30 and 60) are passes to xy_plot1 and xyplot2 function

JavaScript

Advertisement

Answer

Be careful! Your theta argument for the xyplot() function is in degrees, but inside your function, the math.sin() function takes the argument for the angle in units of radians. The easiest fix is to provide your theta argument in units of radians instead of degrees.

You also don’t need both functions if they do the exact same thing, as plt.plot() will draw subsequent projectile curves along with previous ones as long as you don’t clear the plot.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement