I'm using Google Places API to get a list of establishment near a geo location, and I'm trying to figure out how to move 1km north and get geo coordinates there and then do another Google API call.
Ideally I'd like to be able to go into any direction for any distance and get the geo coordinates. Where do i start? If this is not possible then please let me know.
I'm not getting anything. Please have a look. How exactly do i use the direction. How do i go north?
$lat = "40.712714";
$lon = "-74.005997";
$direction = "80";
$length="2000";
move($lon, $lat, $direction, $length);
function move($cx,$cy,$direction,$length){
$x=$cx*cos($direction*M_PI/180)+$length;
$y=$cy*sin($direction*M_PI/180)+$length;
return array($x,$y);
echo $x;
echo $y;
}
EDIT I just tried changing the coordinates number manually and it seems to do what I want. For example I take these coordinates
40.717828,-73.998672
and changed the 3rd decimal number. That moved my location north.
40.710828,-73.998672