The use of λ₁ and φ₂ instead of l1 and a2 or x1 and y2 or longitude1 and latitude2 is cute, but really not that big a practical improvement.
Sure someone can pattern-match the code to the already-derived line in a reference book somewhere, but that doesn’t help at all with reasoning about the geometrical relationships or developing new algorithms, following control flow, building abstractions, improving precision, handling edge cases, ...
It’s mostly helpful when you want to treat your formulas as an externally defined black box.
* * *
Aside: The problem in this particular example is that spherical coordinates and spherical trigonometry are just not a very good formalism for calculating anything, in either theory or practice. Unfortunately cartography, geodesy, etc. are bound by tradition and there hasn’t been much effort to switch them to better tools.
I’ve been trying to read a spherical trigonometry textbook (Todhunter, 1878) the last few days and following along is a huge pain.
Much better is to switch to cartesian coordinates or stereographically projected coordinates, and then use vector methods (and skip writing explicit coordinates in your code to the extent possible). All of the proofs and derivations get nicer, with geometrically meaningful steps and conclusions. Now your points can just be called p and q or a and b (or if you have a lot of them and aren’t pressed for space in each expression, points[i] and points[i+1]), and the coordinates stay internal.
In addition to using clearer code, the calculations will also be faster, more precise, with better numerical stability, take up less memory/bandwidth, ...
Here’s some general math for an arbitrary-dimensional sphere; for just the 2-sphere everything is simpler. http://geocalc.clas.asu.edu/pdf/CompGeom-ch3.pdf