The hypotenuse should always be 9.8 m/s^2, but the calculations are done as the atan of theta.
The vertical to bottom and vertical to top are easily calculated using the angles. A negative sign means that the location is below the phone, while a positive sign means that the location is above the phone.
The rocket height is the (vertical to top) - (the vertical to bottom).