I said a "Class" because while trying to find something to build a class on, I noticed that a projectile could fit perfectly. In fact, a projectile, or any other object which when launched, moves along a curved path under the action of gravity only, has some characteristics: speed, mass, etc...
Displaying all these characteristics through a class can be at the same time both fun and useful for practicing with classes.
The basic assumptions of this kind of motion are the following:
- There is no air friction
- The only significant force which acts on the projectile is gravity
Additional assumptions:
- Projectile starts at y = 0 (from ground)
If you'd like to gather more information on this kind of motion, check out wikipedia:
http://en.wikipedia.org/wiki/Projectile_motion
Here are the results:
Here is a video I made with the instance p and the last method:
It would be fun to implement air friction and then compare the data.
If you find incorrect physics terms please let me know or comment, I might not fully remember my physics classes!! :)
Thanks for the code. My professor has assigned me to plot the projectile projected from height(h) = 5m at an angle of 30(deg) to the horizontal with initial velocity 5m/s. I don't know when I will finish that .. :(
ReplyDeleteDear Mic, your code is useful for us, and i thanks to you for make and posted them here.
ReplyDeletebut i have trouble when run this code with anaconda(python3.6) even python 3.2, the annot is same
"
File "", line 84
plt.show() = Projectile_motion(0,600,np.pi/3)
^
SyntaxError: can't assign to function call
"
may you can help me to tell the problem ?
I was wondering what the "a" meant in your code? it's found first on line 38 stating (a*2).
ReplyDeleteThank you