3 ms·
I appreciate your earnestness, but running your code gives: 0 (0.0, 0.01) (0.0, 0.01) 1 (4.91, 9.82) (4.91, 9.82) 2 (19.63, 19.63) (19.63, 19.63) 3 (44
by ctchocula 8y ago
I appreciate your earnestness, but running your code gives:
0 (0.0, 0.01) (0.0, 0.01)
1 (4.91, 9.82) (4.91, 9.82)
2 (19.63, 19.63) (19.63, 19.63)
3 (44.16, 29.44) (44.16, 29.44)
4 (78.5, 39.25) (78.5, 39.25)
5 (122.65, 49.06) (122.65, 49.06)
6 (176.61, 58.87) (176.61, 58.87)
7 (240.38, 68.68) (240.38, 68.68)
8 (313.96, 78.49) (313.96, 78.49)
9 (397.35, 88.3) (397.35, 88.3)
10 (490.55, 98.11) (490.55, 98.11)
- tzs 8y agoIt's Python 3. You ran it with Python 2. In Python 2, 1/2 == 0. In Python 3, 1/2 == 0.5. That means that in the drag function, this expression: 1/2 * p * Cd * math.pi * r**2 * v**2 always gives 0 on Python 2 because of that 1/2 factor. If you want to run it on Python 2, either change the 1/2 in the drag function to 1./2 or 0.5, or add from __future__ import division at the top to tell Python 2 you want to use the Python 3 division behavior.
- ctchocula 8y agoThen I stand corrected. Thank you for being patient.