Background Info
Consider a spherical coordinate system like the one shown here:
(source: shokhirev.com)
For a particular point, we specify its location by (r, theta, phi).
A plane can be described in this coordinate system as the set of all points (r, theta, phi) such that phi = phi'.
The Problem
Assume we have a single plane given by a fixed phi=phi'. For an arbitrary point (r, theta, phi) what are the fastest and simplest ways to compute the distance from (r, theta, phi) to the plane defined by phi=phi'?
Essentially, I am trying to find a simple formula for point to plane distance in spherical coordinates.
What I've tried
I think it would suffice to simple convert from spherical to Cartesian coordinates to generate a point (x,y,z) = (r, theta, phi) and then to generate a plane also in Cartesian coordinates. Then I could use standard formulae for the distance from a point to a plane in Cartesian coordinates. This approach is not optimal since I need to run this computation billions of times in the inner loop of my code.
An ideal answer would tell me how do compute this distance without transforming into Cartesian coordinates. However, it would also be useful if someone could verify that my idea in "What I've tried" is reasonable.
Thanks in advance!