This is a true work of art. It is also incomprehensible to anyone else. This type insists on making the problem more complicated than it really is. Engineers hang onto an idea tenaciously until they find a way to make it work. This is a concise algorithmic solution to the problem that completely avoids any tests.
Surveyors begin every problem by first converting to a bearing or azimuth.
The worst part is that even a mathematician can't understand their documentation. These are likely to be the most sophisticated solutions to the problem. One can only hope that the documentation will be good enough to follow what he's doing. This is actually a very good program. Every conceivable error trap has been included in case the user makes a mistake.