reference Information
Consider a spherical coordinate system similar to that shown here:

(source: shokhirev.com )
For a specific point, we indicate its location using (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 '.
Problem
Suppose we have a single plane defined by a fixed phi = phi '. For an arbitrary point (r, theta, phi), what are the quickest and easiest ways to calculate the distance from (r, theta, phi) to a plane defined as phi = phi '?
In fact, I'm trying to find a simple formula for the distance from a point to a plane in spherical coordinates.
What i tried
I think that it would be simple enough to convert spherical to Cartesian coordinates to generate a point (x, y, z) = (r, theta, phi), and then create a plane also in Cartesian coordinates. Then I could use standard formulas for the distance from a point to a plane in Cartesian coordinates. This approach is not optimal, since I need to do this calculation billions of times in the inner loop of my code.
An ideal answer would tell me how to calculate this distance without converting to Cartesian coordinates. However, it would also be helpful if someone could verify that my idea of βββWhat I triedβ is reasonable.
Thanks in advance!
source share