Trying to work out distance between two points (lat & lng)
I have an issue because PHP is (after running through my distance function) returning the same distance regardless.
I break it down and I find that PHP has an issue with some maths
For this example, assume: Lat2: 49.263205
So, I want to convert lat2 to a radian
$pi = pi();
$radianlat2 = $lat2 * ( $pi / 180);
and PHP is failing, it's giving me the same number everytime, regardless of the lat I feed it.
If I break it down I can explain:
$pi / 180 = 0.017453292519943
49.263205 * 0.017453292519943 = 0.859805127334919
BUT if you echo $radianlat2 above you get: 0.85521133347722
Did I just break PHP or am I loosing the plot?