The equation for the height (y) as a function of time for an object (ignoring air resistance) is: $$ y(t) = \frac{1}{2} a t^2 + v_0 t + y_0 $$ where: $$ a = \text{acceleration} $$ $$ t = \text{time} $$ $$ v_0 = \text{initial velocity} $$ $$ y_0 = \text{initial position/height} $$ and the velocity (v) is: $$ v(t) = at + v_0 $$
Notes and Code | Outcome | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic ProgramWrite a program that calculates the position and velocity of an object with:
|
|
||||||||||||||||||||||||||||||||||||
FunctionsIf you have not already, write two functions to calculate position (y) and velocity (v) for a given time. Let your function have default values for acceleration (9.8), initial velocity (0), and initial position (0). |
|
||||||||||||||||||||||||||||||||||||
ClassCreate a ballistics class that has methods to calculate the position and velocity when given a specific time. |
|
||||||||||||||||||||||||||||||||||||
Maximum HeightWrite a program/method to determine the maximum height of the object. |
|