[Math] Calculating longitude degrees from distance

spherical coordinatestrigonometry

I need to calculate how many longitude degrees a certain distance from a point are, with the latitude held constant. Here's an illustration:

enter image description here

Here x represents the longitude degrees, the new point can be on either side of the starting point. I'm using the haversine formula, which calculates the distance between two points on a sphere given a radius, $r$, and a pair of coordinates expressed in latiude, $\phi$, and longitude, $\lambda$, degrees:

$d=2r\arcsin\left(\sqrt{\sin^2\left(\dfrac{\phi_{2}-\phi_{1}}{2}\right)+\cos(\phi_{1})\cos(\phi_{2})\sin^2\left(\dfrac{\lambda_{2}-\lambda_{1}}{2}\right)}\right)$

Which can be reduced to, because of the latitude held constant:

$d=2r\arcsin\left(\sqrt{\cos^2(\phi_{1})\sin^2\left(\dfrac{\lambda_{2}-\lambda_{1}}{2}\right)}\right)$

I plugged it into WolframAlpha to isolate $\lambda_{2}$, and got these two solutions:

$\lambda_{2}=\lambda_{1}-2\arcsin\left(\sec(\phi_{1})\sqrt{\sin\left(\dfrac{d}{2r}\right)}\right)$

$\lambda_{2}=2\arcsin\left(\sec(\phi_{1})\sqrt{\sin\left(\dfrac{d}{2r}\right)}\right)+\lambda_{1}$

Here's an example of why I'm confused about this. The distance between two points, $40° lat, 10° lng$ and $40° lat, 11° lng$ is (we assume an earth radius of $6371km$):

$d=2*6371km*\arcsin\left(\sqrt{\cos^2(40°)\sin^2\left(\dfrac{11°-10°}{2}\right)}\right)=85.1798km$

Plugging those numbers into the 2nd of the two isolated formulas, we get:

$\lambda_{2}=2\arcsin\left(\sec(40°)\sqrt{\sin\left(\dfrac{85.1798km}{2*6371km}\right)}\right)+10°=10.0282$

Which is obviously quite far from our desired $11°$, what am I doing wrong here?

Best Answer

The problem is that you must have made a mistake while copying your formula in Mathematica. After extracting $\Delta\lambda$ from the formula of $d$, knowing $\phi$ constant, I obtain (when $\phi\neq\pi/2 + k\pi$): $$ \Delta\lambda = \pm 2 \arcsin\left\lvert \frac{\sin\frac{d}{2r}}{\cos\phi_1} \right\lvert $$

I must say I'm concerned that in this formula, the argument of arcsin might become greater than 1.. I did this rapidly but I might try to check how this works. Oh, and use radians with trig functions.

Edit: Here is your example with Matlab:

>> phi = 40 * pi/180; a = 10 * pi/180; b = 11*pi/180;
>> r = 6371;
>> d = 2*r*asin( sqrt( cos(phi)^2 * sin( (a-b)/2 )^2 ) )
d =  85.180
>> delta = 2*asin( abs( sin(d/(2*r))/cos(phi) ) )
delta =  0.017453
>> b-a
ans = 0.017453
Related Question