Hi Rossko,
Thanks for the heads up..i've tried using the formula but it seems to
give me the same coordinate no matter the start point or the
bearings...i think there's something wrong with my bearings in the
javascript below...and ideas?
function threeOneFive(){
var brng = 90;
var brng = brng.toRad(); //bearings to radians
var Radius = 6371;
var dist= 0.315/Radius;
var lat1= markers[0].getPosition().lat().toRad();
var lon1=markers[0].getPosition().lng().toRad();
var lat2 = Math.asin( Math.sin(lat1)*Math.cos(dist) +
Math.cos(lat1)*Math.sin(dist)*Math.cos(brng) );
var lon2 = lon1 +
Math.atan2(Math.sin(brng)*Math.sin(dist)*Math.cos(lat1),
Math.cos(dist)-
Math.sin(lat1)*Math.sin(lat2));
lon2 = (lon2+3*Math.PI)%(2*Math.PI) - Math.PI; // normalise to
-180...+180
var destin = new google.maps.LatLng(lat2, lon2);
}
On Jul 27, 3:40 pm, Rossko <[email protected]> wrote:
> > The problem with this is...i only have the value of 1 coordinate
>
> Yes, but you have the known distance and bearing.
> You just need to recast the formula so that point 1 and distance are
> known, and point 2 is the solution at a particular bearing.
> See
> http://www.movable-type.co.uk/scripts/latlong.html
> "Destination point given distance and bearing from start point"
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.