For this exercise you will have to create a [projectile motion](https://cimg2.ck12.org/datastreams/f-d%3Abb024be6673110b31e78b46819e792adaed8dc661e082a61f0a6d64e%2BIMAGE%2BIMAGE.1).
For this exercise, you will have to create a [projectile motion](https://cimg2.ck12.org/datastreams/f-d%3Abb024be6673110b31e78b46819e792adaed8dc661e082a61f0a6d64e%2BIMAGE%2BIMAGE.1).
A structure called `Object` will be provided which will have all variables that are
Two structures will be provided. A structure called `ThrowObject` that will contain all the variables that are
essential for the projectile physics. (distance, velocity, height, time)
essential for the projectile physics (initial position, initial velocity, current position, current velocity and time).
A structure called `Object` which will have the corresponding values of X and Y of the initial position, the initial velocity, the current position and the current velocity.
You must implement :
You must implement :
- A function `throw_object` that will initialize the Object with a given velocity and height.
- A function `new` that will initialize the ThrowObject with a given initial position and an initial velocity.
- The trait Iterator with the `.next()` in which,the next position of the object after 1 second, must be calculated.
- The trait Iterator with the `.next()` in which the position and speed of the object must be calculated after 1 second.
It will return an `Option` with the Object or it will return `None` if the object already reached the floor.
It will return an `Option` with the ThrowObject, or it will return `None` if the ThrowObject has already reached the floor.
Consider the value of gravity is 9.8m/(s*s) and that the position (p) in the instant s of an object is given by:
![Position Formula](position_formula.png)
and velocity (v) in the instant s of an object is given by: