Hi Frendz,
I have a latitude and longitude points of particular place namely X. Now I want to check the given latitude and longitude point of a place namely Y is within a circumstance of a particular radius from that point X. How to check that? i'm using google map.

## Featured Replies in this Discussion

• 1. count distance between x and y point. 2. check wheather it is less than radious (y is inside) it is greater than radious (y is outside)

1. count distance between x and y point.
2. check wheather it is less than radious (y is inside)
it is greater than radious (y is outside)

1. count distance between x and y point.
2. check wheather it is less than radious (y is inside)
it is greater than radious (y is outside)

Yes.. Its soved using the following code

\$lat1=mysql_result(\$rs_area,0,"lat");
\$lon1=mysql_result(\$rs_area,0,"lng");

\$lat2=\$row['latitude'];
\$lon2=\$row['longitude'];
\$R = 6371; // Radius of the earth in km
\$a = sin(\$dLat/2) * sin(\$dLat/2) +
sin(\$dLon/2) * sin(\$dLon/2);
\$c = 2 * atan2(sqrt(\$a), sqrt(1-\$a));
\$d = \$R * \$c; // Distance in km
Question Answered as of 4 Years Ago by vibhaJ
Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You