Vincenty — Distance calculation

This document shows the numerical process used to solve the inverse geodesic problem with Vincenty: iterations of \(\lambda\), intermediate values (\(\sin\sigma,\cos\sigma,\sigma,\sin\alpha,\cos^2\alpha,\cos2\sigma_m\)), the corrections (\(u^2,A,B,\Delta\sigma\)), and the bearing calculations.

1) Input data

Origin: Les Sables-d'Olonne — φ₁ = 46.494953°, λ₁ = −1.792091°
Destination: Saint-François — φ₂ = 16.252360°, λ₂ = −61.273320°

We convert to radians (for trigonometric calculations):

$$\varphi_1 = 0.8114900154100151\ \text{rad}, \quad \varphi_2 = 0.2836571932194256\ \text{rad}$$ $$L = \Delta\lambda = \lambda_2-\lambda_1 = -1.0381432891827342\ \text{rad}$$

2) WGS-84 constants

$$a = 6378137.0\ \text{m}, \quad f = 1/298.257223563, \quad b = a(1-f) = 6356752.314245179\ \text{m}$$

3) Reduced latitude (U)

$$\tan U_i = (1-f)\tan\varphi_i$$ $$U_1 = 0.8098129355598864\ \text{rad}, \quad U_2 = 0.282756108427017\ \text{rad}$$

Short explanation: U is the latitude “projected” onto an auxiliary sphere — it simplifies trigonometry on the ellipsoid.

4) Iteration to find \(\lambda\)

Start: \(\lambda_0 = L\). At each iteration we compute a series of intermediate values and update \(\lambda\) using Vincenty’s formula. We repeat until the change in \(\lambda\) is smaller than \(10^{-12}\) rad.

Equations used at each iteration (for reference):

\[\sin\sigma = \sqrt{(\cos U_2 \sin \lambda)^2 + (\cos U_1 \sin U_2 - \sin U_1 \cos U_2 \cos \lambda)^2}\] \[\cos\sigma = \sin U_1 \sin U_2 + \cos U_1 \cos U_2 \cos \lambda\] \[\sigma = \operatorname{atan2}(\sin\sigma,\cos\sigma)\] \[\sin\alpha = \frac{\cos U_1 \cos U_2 \sin \lambda}{\sin\sigma},\quad \cos^2\alpha = 1-\sin^2\alpha\] \[\cos2\sigma_m = \cos\sigma - \frac{2\sin U_1 \sin U_2}{\cos^2\alpha}\] \[C = \frac{f}{16}\cos^2\alpha\left(4 + f(4-3\cos^2\alpha)\right)\] \[\lambda_{n+1} = L + (1-C)f\sin\alpha\left(\sigma + C\sin\sigma\left(\cos2\sigma_m + C\cos\sigma(-1+2\cos^2 2\sigma_m)\right)\right)\]

Iteration table (numerical values)

In the table you can see, for each iteration: \(\lambda\), the change \(\Delta\lambda\), \(\sin\sigma\), \(\cos\sigma\), \(\sigma\), \(\sin\alpha\), \(\cos^2\alpha\), and \(\cos2\sigma_m\).

Iterλ (rad)Δλsinσcosσσ (rad)sinαcos²αcos2σₘ
0 (start)-1.0381432891827342-
1-1.0404171135171536-0.002273824334419360.839510.543310.99322-0.672450.54739-0.21772
2-1.0404214142043005-0.000004300687146850.843100.537901.00175-0.676900.54204-0.21005
3-1.0404214223337993-8.1295e-090.843550.537051.00387-0.677220.54138-0.20935
4-1.0404214223491663-1.54e-110.843550.537051.00387-0.677220.54138-0.20935
5 (final)-1.0404214223491954-2.91e-140.84355325810.53704552951.003865549518566-0.677215388950.54137931697-0.20935377160

Note how λ converges quickly (5 iterations here). The values of \(\sin\sigma\), \(\cos\sigma\), and \(\sigma\) also stabilize.

5) Ellipsoidal corrections and distance

Using the final values:

$$u^2 = \cos^2\alpha \cdot \frac{a^2-b^2}{b^2} = 0.0036486241430452784$$ $$A = 1 + \frac{u^2}{16384}\left(4096 + u^2(-768 + u^2(320 - 175u^2))\right) = 1.000911532961068$$ $$B = \frac{u^2}{1024}(256 + u^2(-128 + u^2(74 - 47u^2))) = 0.0009104954804571988$$ $$\Delta\sigma = B\sin\sigma\Big[\cos2\sigma_m + \frac{B}{4}\big(\cos\sigma(-1+2\cos^2 2\sigma_m) - \frac{B}{6}\cos2\sigma_m(-3+4\sin^2\sigma)(-3+4\cos^2 2\sigma_m)\big)\Big]$$ $$\Delta\sigma = -0.00016088012080655317\ \text{rad}$$ $$s = b\,A\,(\sigma - \Delta\sigma) = 6\,388\,165.050133844\ \text{m}$$ $$s = 6\,388.165050133844\ \text{km}$$ $$s_{NM} = \frac{s}{1852} = 3\,449.3331804178424\ \text{NM}$$

6) Bearings — explanation and calculation

Vincenty also provides the initial bearing (\(\alpha_1\)) and the final bearing (\(\alpha_2\)). We compute them from the reduced latitudes and the final \(\lambda\).

Formulas (angles in radians):

$$\alpha_1 = \operatorname{atan2}\big(\cos U_2 \sin \lambda, \; \cos U_1 \sin U_2 - \sin U_1 \cos U_2 \cos \lambda\big)$$ $$\alpha_2 = \operatorname{atan2}\big(\cos U_1 \sin \lambda, \; -\sin U_1 \cos U_2 + \cos U_1 \sin U_2 \cos \lambda\big)$$

Results (converted to degrees and normalized to 0°–360°):

$$\alpha_1 = 259.11026968403183^\circ \quad (\text{initial bearing})$$ $$\alpha_2 = 224.84728561996576^\circ \quad (\text{final bearing})$$

Interpretation: 259.11° means that, from Les Sables-d'Olonne, one must sail approximately west-southwest to follow the geodesic toward Saint-François. The final bearing of 224.85° indicates the direction of the trajectory at the destination point (looking toward true north from the arrival point).

7) Final summary (key values)

QuantityValue
Final λ-1.0404214223491954 rad
σ1.003865549518566 rad
Δσ-0.00016088012080655317 rad
A1.000911532961068
B0.0009104954804571988
0.0036486241430452784
Distance6,388,165.05 m ≈ 6,388.17 km
Distance3,449.33 NM
Initial bearing α₁259.11026968403183°
Final bearing α₂224.84728561996576°

8) Final notes and practical considerations