I\'ve been attempting to implement Vincenty\'s formulae with the following:
/* Implemented using Vincenty\'s formulae from http://en.wikipedia.org/wiki/V
Have you tried this:
https://github.com/treffynnon/Geographic-Calculations-in-PHP
There are a number of errors in transcription from the wikipedia page Direct Problem section:
u2 expression has 2 in the denominator where it should have b2;A and B expressions are inconsistent about whether the initial fraction factor needs to be parenthesised to correctly express a / b * c as (a/b) * c - what happens without parentheses is a php syntax issue which I don't know the answer to, but you should favour clarity;[ is cos sigma (-1 etc, whereas you have cos (-1 etc, which is very different;cos2 x means (cos x)(cos x), not cos cos x!sin($sinalpha) where it should have a sin($sinalpha)*sin($sinalpha);I think that's all.