PHP giving wrong calcuation

karly

New Member
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 mathsFor this example, assume:Lat2: 49.263205So, I want to convert lat2 to a radian\[code\]$pi = pi();$radianlat2 = $lat2 * ( $pi / 180);\[/code\]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.01745329251994349.263205 * 0.017453292519943 = 0.859805127334919BUT if you echo $radianlat2 above you get: 0.85521133347722Did I just break PHP or am I loosing the plot?
 
Back
Top