Get distance of locations |
Hi
I have many locations(about 1000 location) I need calculate distance between this location My code is : PHP Code: function distance($lat1, $lon1, $lat2, $lon2, $unit) { I calculate distance between two location with foreach PHP Code: foreach($result as $row) { In each loop,i save previous location and get distance from their But it is wrong Does anybody can help me?
(10-30-2018, 01:59 AM)omid_student Wrote: "is the maths part wrong?" what do you mean? I'm just trying to understand what part you have problem with from your original post. As far as I can see, from the source provided, there could be only two issues - either the calculation between two points is incorrect, or you have issues with feeding in correct points. You should try to specify what and why you think it's not working, and it'll be easier for us to help you, that's all
(10-30-2018, 03:16 AM)Pertti Wrote:(10-30-2018, 01:59 AM)omid_student Wrote: "is the maths part wrong?" what do you mean? Sorry my problem was solved My locations not arranged by asc or desc Thank you |
Welcome Guest, Not a member yet? Register Sign In |