Reverse function haversine

282 Views Asked by At

I want to know, If There is a possibility to get a reverse haversine functions.

With that, I want to say that If I have a distance between two cities, how can I get latitude and longitude.

Thank you very much.

1

There are 1 best solutions below

0
On

There is an inverse of the haversine function

$$\operatorname{hav}(\theta) = \sin^2\left(\frac{\theta}{2}\right) = \frac{1 - \cos(\theta)}{2}$$

$$\implies \operatorname{hav}^{-1}(x) = 2 \sin^{-1}\left(\sqrt{x}\right) = \cos^{-1} \left(1-2x\right)$$

and there are the usual issues, as with other trigonometric inverses, of domain and image.

There is not an inverse of the haversine formula

$$\operatorname{hav}\left(\Theta\right) = \operatorname{hav}\left(\varphi_2 - \varphi_1\right) + \cos\left(\varphi_1\right)\cos\left(\varphi_2\right)\operatorname{hav}\left(\lambda_2 - \lambda_1\right)$$

since a single angle (or distance) cannot be converted uniquely back to the longitudes and latitudes.