Suppose the parallel arc of the radius $r$, latitude $\varphi$, centered at $[0,q]$ passing through three points $[0,2\varphi/\pi]$, $[\cos\varphi,\sin\varphi]$, and $[-\cos\varphi,\sin\varphi]$,
$$ x^{2}+(y-q)^{2}=0+(\frac{2\varphi}{\pi}-q)^{2}=\cos^{2}\varphi+(\sin\varphi-q)^{2}=r^{2}\Rightarrow q=\frac{1-(2\varphi/\pi)^{2}}{2(\sin\varphi-2\varphi/\pi)}, $$
and the meridian arc of the radius $R$, longitude $\lambda$, centered at $[-p,0]$ passing through three points $[2\lambda/\pi,0]$, $[0,1]$,and $[0,-1]$,
$$ (x+p)^{2}+y^{2}=(\frac{2\lambda}{\pi}+p)^{2}=p^{2}+1=R^{2}. $$
Let and $[x,y]$ be the known Cartesian coordinates of a point, and $[\varphi,\lambda]$ its determined spherical coordinates. For$\lambda$, it leads to the quadratic equation
$$ \frac{4\lambda^{2}}{\pi^{2}}+\frac{4\lambda p}{\pi}=1\wedge x^{2}+2px+y^{2}=1,\Rightarrow4\lambda^{2}+4p\pi\lambda-\pi^{2}=0, $$ where $$ p=\frac{1-x^{2}-y^{2}}{2x}=\frac{(1-(2\lambda/\pi)^{2}}{4\lambda/\pi}. $$
For $\varphi$, comparing both equations \begin{align*} x^{2}+y^{2}-1 & =2qy-2q\sin\varphi\Rightarrow q=\frac{x^{2}+y^{2}-1}{2(y-\sin\varphi)}, \end{align*}
and substituting for $q$ \begin{align*} x^{2}+y^{2} & =2q(y-\frac{2\varphi}{\pi})+\frac{4\varphi^{2}}{\pi^{2}}=\frac{x^{2}+y^{2}-1}{y-\sin\varphi}(y-\frac{2\varphi}{\pi})+\frac{4\varphi^{2}}{\pi^{2}}. \end{align*}
leads to the transcendental equation
\begin{align*} F(\varphi) & =(x^{2}+y^{2})(\pi\sin\varphi-2\varphi)\pi+4\varphi^{2}(y-\sin\varphi)+2\pi\varphi-\pi^{2}y=0.\\ F^{\prime}(\varphi) & =(2\pi+8\varphi)(y-\sin\varphi)-4\varphi^{2}\cos\varphi+\pi(x^{2}+y^{2})(\pi\cos\varphi-2)). \end{align*}
Example:
Suppose that $\varphi\in(-\pi/2,\pi/2)$ and $\lambda\in(-\pi,\pi)$.
$x=-0.249587194$, $y=-1.112370369$, (corresponding with $\varphi=-78^{\circ}$, $\lambda=-159^{\circ}$).
Unfortunately, $F(\varphi)$ is not convex and has multiple roots:$\varphi_{1}=-78^{\circ}$, $\varphi_{2}=-90^{\circ}$, $\varphi_{3}\approx-110^{\circ}$, so the Newton's method $\varphi_{i+1}=\varphi_{i}-F(\varphi_{i})/F^{\prime}(\varphi_{i})$ converges to any of them.
Questions:
- Is there any analytic solution for $\varphi$ using a substitution?
- If not, which method do you recommend for this transcendental equation with multiple roots?
Thanks for your help.
Matlab code:
%Input points
lat = -78 *pi / 180
lon = -159 * pi /180
%Forward transformation
q = (1 - (2 * lat / pi)^2) / (2 * (sin(lat) - 2 * lat / pi));
p = (1 - (2 * lon / pi)^2) / (4* lon / pi);
%x
a = p^2 + q^2;
b = 2*(p*q^2 - p*q*sin(lat));
c = q^2*(sin(lat)^2 - 1);
discr = b^2 - 4*a*c;
if (lon < 0); x = (-b - sqrt(discr))/(2*a); else; x=(-b + sqrt(discr))/(2*a); end;
%y
y = sin(lat) - p / q * x;
%Inverse transformation
lat = -90*pi/180:0.01:90*pi/180
%lat = -115*pi/180:0.01:-70*pi/180
F = ((x^2 + y^2) * (pi * sin(lat) - 2 * lat) * pi + 4 * lat .^2 .* (y - sin(lat)) + 2 * pi * lat - pi^2 * y)
plot (lat * 180 / pi,F)
%Newton's method
latr = -85 * pi/180 //initial value
for i = 1 : 10
dF = (2 * pi + 8*latr*(y - sin(latr)) - 4*latr^2*cos(latr) + pi*(x^2 + y^2)*(pi*cos(latr) - 2))
F = ((x^2 + y^2) * (pi * sin(latr) - 2 * latr) * pi + 4 * latr ^2 * (y - sin(latr)) + 2 * pi * latr - pi^2 * y)
latr = latr - F / dF
end
