Apr-21-2017, 02:42 AM
Hi all, I'm very new to python and I have no prior experience with other coding languages, so my main issues are with the formatting and finding the appropriate vocabulary.
My goal is to determine the maximum height a ball reaches when thrown straight up. I already wrote the code for the visual of the ball, but I don't know how to find and display a maximum value. Any other advice or suggestions in regards to the code I already have would also be greatly appreciated.
Thanks!
My goal is to determine the maximum height a ball reaches when thrown straight up. I already wrote the code for the visual of the ball, but I don't know how to find and display a maximum value. Any other advice or suggestions in regards to the code I already have would also be greatly appreciated.
Thanks!

from visual import * myuniv = display(range = vector(3,3,3)) So = vector(0,1,0) Vo = vector(0,6,0) a = vector(0,-9.8,0) s = vector(0,2,0) dt = 0.1 t = 0.0 ball = sphere(pos = s, radius = 0.25, color = color.cyan) while s.y > -2.0: rate(25) s = .5*a*t**2 + Vo*t + So v = a*t + Vo t = t + dt ball.pos = s ballghost = sphere(pos = s, radius = .2)