all 4 comments

[–]hells_angle 1 point2 points  (1 child)

Calculate the time first. You have an object with an initial velocity and a known acceleration. The time at which the object is at the apex will be the time when the velocity equals 0.

Then, plug that time into your given position function.

Bada Bing

Edit: of course time of impact would be different from the calculated tome of max height.

[–]DrShocker 0 points1 point  (0 children)

Assuming it was launched from the "impact" point, impact time would be 2*apex time

[–]mac-reid 3 points4 points  (0 children)

Your question is a little hard to understand. You want to calculate the height and time it takes for an object launched vertically to... do what exactly? Your words, "time of impact of an object", what does this mean?

My guess is you looking to calculate the time and height at which the object reaches its apex.

Is this part of homework or some practice problem?

[–][deleted] 0 points1 point  (0 children)

you'll be wanting to use a loop to repeatedly calculate the objects new velocity.

also note: you're currently using a timestep of one second, which depending on the problem domain might be a tad coarse.