Skip to content

Commit

Permalink
add doc to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Can Pekesen committed Nov 29, 2015
1 parent 7b22598 commit a62cda7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -249,6 +249,24 @@ Checks if a coordinate is already in decimal format and, if not, converts it to
<pre>geolib.useDecimal("51° 29' 46\" N"); // -> 51.59611111
geolib.useDecimal(51.59611111) // -> 51.59611111</pre>

<h3>geolib.computeDestinationPoint(lat, lon, distance, bearing, radius(optional))</h3>

Computes the destination point given an initial point, a distance and a bearing

If no radius is given it defaults to the mean earth radius of 6371000 meter.

Returns an object: `{"latitude": destLat, "longitude": destLng}`

<h4>Example</h4>

<pre>var initialPoint = {lat: 51.516272, lon: 0.45425}
var dist = 1234;
var bearing = 45;

geolib.computeDestinationPoint(initialPoint.lat, initialPoint.lon, dist, bearing);
// -> {"latitude":51.52411853234181,"longitude":0.4668623365950795}
</pre>

<h2>Changelog</h2>
<h3>v2.0.0+beta1</h3>
- Dropped support for IE6, IE7, IE8
Expand Down
14 changes: 7 additions & 7 deletions dist/geolib.js
Expand Up @@ -2,11 +2,11 @@
* Library to provide geo functions like distance calculation,
* conversion of decimal coordinates to sexagesimal and vice versa, etc.
* WGS 84 (World Geodetic System 1984)
*
*
* @author Manuel Bieh
* @url http://www.manuelbieh.com/
* @version 2.0.18
* @license MIT
* @license MIT
**/;(function(global, undefined) {

"use strict";
Expand Down Expand Up @@ -1218,12 +1218,12 @@
*
* see http://www.movable-type.co.uk/scripts/latlong.html for the original code
*
* @param float latitude of the inital point
* @param float longitude of the inital point
* @param float latitude of the inital point in degree
* @param float longitude of the inital point in degree
* @param float distance to go from the inital point in meter
* @param float bearing of the direction to go, e.g. 0 = north, 180 = south
* @param float optional, defaults to mean radius of the earth
* @return object {latitude: destLat, longitude: destLng}
* @param float bearing in degree of the direction to go, e.g. 0 = north, 180 = south
* @param float optional (in meter), defaults to mean radius of the earth
* @return object {latitude: destLat (in degree), longitude: destLng (in degree)}
*/
computeDestinationPoint: function(lat, lon, distance, bearing, radius) {
radius = (radius === undefined) ? 6371e3 : Number(radius);
Expand Down
10 changes: 5 additions & 5 deletions src/geolib.js
Expand Up @@ -1209,12 +1209,12 @@
*
* see http://www.movable-type.co.uk/scripts/latlong.html for the original code
*
* @param float latitude of the inital point
* @param float longitude of the inital point
* @param float latitude of the inital point in degree
* @param float longitude of the inital point in degree
* @param float distance to go from the inital point in meter
* @param float bearing of the direction to go, e.g. 0 = north, 180 = south
* @param float optional, defaults to mean radius of the earth
* @return object {latitude: destLat, longitude: destLng}
* @param float bearing in degree of the direction to go, e.g. 0 = north, 180 = south
* @param float optional (in meter), defaults to mean radius of the earth
* @return object {latitude: destLat (in degree), longitude: destLng (in degree)}
*/
computeDestinationPoint: function(lat, lon, distance, bearing, radius) {
radius = (radius === undefined) ? 6371e3 : Number(radius);
Expand Down

0 comments on commit a62cda7

Please sign in to comment.