Calculating sectors of circles around a latitude & longitude w/ PHP
Hey everybody! Figured I'd try asking this here as a couple of days of wandering around stackoverflow hasn't proven very successful.
I'm basically building an angularjs front end/laravel back end application and want to know if what I'm currently using the Google Maps API for can be done with a PHP package or something.
I'm using it to draw sectors around a latitude and longitude (for example, two sectors would be two halves of a circle) and then determine whether or not another latitude and longitude falls inside of which sector.
@youkaihiei I'm not sure I am following what you are doing (so this might be way off) but I am using this code below to figure out locations (using lat/long) that are within a certain distance of a point. This is being used to show properties within a certain number of miles of a lat/long combo. I'm pulling the values from a database table with coordinates:
The white dot in the middle is a latitude/longitude. A and B are each sectors of the circle made up of the radius around the circle (lets say 5 miles), so A is 0 degrees to 180 degrees and B is 180 degrees to 360 degrees, 5 miles away from the middle. The yellow dot is another latitude/longitude.
Right now I have this generated using the google maps api using the polygon plugin and the geometry plugin to find out if a given latitude/longitude falls inside of a polygon.
I'm trying to find out if theres an equivalent way to do that sort of thing in PHP.