Or better yet: http://www.movable-type.co.uk/scripts/latlong.html
Look for: *Destination point given distance and bearing from start point* On Fri, May 31, 2013 at 3:17 PM, Wally Atkins <[email protected]> wrote: > Maybe this would do the trick for what you need? > > function destination(lat, lng, dist, heading) { > lat *= Math.PI / 180; > lng *= Math.PI / 180; > heading *= Math.PI / 180; > > var lat2 = Math.asin(Math.sin(lat) * Math.cos(dist) + > Math.cos(lat) * Math.sin(dist) * > Math.cos(heading)); > return [180 / Math.PI * lat2, 180 / Math.PI * (lng + > Math.atan2(Math.sin(heading) * Math.sin(dist) * Math.cos(lat2), > Math.cos(dist) - Math.sin(lat) * Math.sin(lat2)))]; > } > > From: > https://groups.google.com/forum/?fromgroups#!topic/google-earth-browser-plugin/s1A_kizmolU > > > On Fri, May 31, 2013 at 2:02 PM, [email protected] < > [email protected]> wrote: > >> Thanks, I will have a look. >> >> >> The move(x, y) method of OpenLayers.Geometry.Point may be helpful. But I >> don't understand the x, y arguments... What are the units of those values? >> >> this could help if I move a clone of pointA. >> >> >> >> Sent from Alto - altomail.com >> >> >> >> ------------------------------ >> *From: *[email protected]<[email protected]> >> *To: *[email protected]<[email protected]> >> *cc: *[email protected]<[email protected]> >> *Sent: *Friday, May 31, 2013 >> *Subject: *Re: [OpenLayers-Users] Draw a line knowing its length in >> meters e it's angle >> >> >> Maybe look into the JSTS? >> >> https://github.com/bjornharrtell/jsts >> >> On Friday, May 31, 2013, [email protected] wrote: >> >>> How do I draw a line, starting from a known point, and knowing only it's >>> length in meters and it's angle? >>> >>> Suppose I have a point at: >>> >>> PointA: >>> lat: -22.29417905166, lon: 19.022827148438 >>> (EPSG:4326) >>> >>> Now I want to draw a line 500 meters long with an angle of 15 degrees (0 >>> degrees is an horizontal line). >>> >>> OpenLayers.Geometry.LineString allows to draw only a point from two >>> points... >>> >>> Any ideas? >>> >>> >>> Sent from Alto - altomail.com >>> >> >
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
