Regarding units of output value
Yes, you're quite right. My mistake.
The result is in terms of degrees. Plot the input expression with phi ranging from -90 to 90 and you will see this.
phi
Sorry, haven't been near my computer for a while. Having checked, I don't think my suggestion works, I wasn't sure that it would - see attached notebook. But the value of phi in your output is definitely in radians.
Thank you for this very nice demonstration. I realised that, in my original function, some of the quantities are in Radians and some are in Degree. Therefore, my results were not consistent.
Thanks for your time.