Skip to content

Commit

Permalink
Version Number Increase
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel committed Aug 3, 2015
1 parent ec0a9d1 commit 2b54fa6
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Geolib v2.0.17
# Geolib v2.0.18
[![Build Status](https://secure.travis-ci.org/manuelbieh/Geolib.png?branch=master)](http://travis-ci.org/manuelbieh/Geolib)

Library to provide basic geospatial operations like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Geolib",
"main": "dist/geolib.js",
"version": "2.0.17",
"version": "2.0.18",
"homepage": "https://github.com/manuelbieh/Geolib",
"authors": [
"Manuel Bieh <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"scripts": {
"test": "grunt travis --verbose"
},
"version": "2.0.17",
"version": "2.0.18",
"main": "dist/geolib.js"
}
4 changes: 2 additions & 2 deletions dist/geolib.elevation.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*! geolib.elevation 2.0.17 by Manuel Bieh
/*! geolib.elevation 2.0.18 by Manuel Bieh
*
* Elevation Addon for Geolib.js
*
* @author Manuel Bieh
* @url http://www.manuelbieh.com/
* @version 2.0.17
* @version 2.0.18
* @license MIT
*/
;(function(global, geolib, undefined) {
Expand Down
4 changes: 2 additions & 2 deletions dist/geolib.elevation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 23 additions & 17 deletions dist/geolib.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
/*! geolib 2.0.17 by Manuel Bieh
/*! geolib 2.0.18 by Manuel Bieh
* 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.17
* @version 2.0.18
* @license MIT
**/;(function(global, undefined) {

"use strict";

function Geolib() {}

// Constants
Geolib.TO_RAD = Math.PI / 180;
Geolib.TO_DEG = 180 / Math.PI;
Geolib.PI_X2 = Math.PI * 2;
Geolib.PI_DIV4 = Math.PI / 4;

// Setting readonly defaults
var geolib = Object.create(Geolib.prototype, {
version: {
value: "2.0.17"
value: "2.0.18"
},
radius: {
value: 6378137
Expand Down Expand Up @@ -69,13 +75,13 @@

if (typeof(Number.prototype.toRad) === 'undefined') {
Number.prototype.toRad = function() {
return this * Math.PI / 180;
return this * Geolib.TO_RAD;
};
}

if (typeof(Number.prototype.toDeg) === 'undefined') {
Number.prototype.toDeg = function() {
return this * 180 / Math.PI;
return this * Geolib.TO_DEG;
};
}

Expand Down Expand Up @@ -429,8 +435,8 @@

coords.forEach(function(coord) {

lat = coord.latitude * Math.PI / 180;
lon = coord.longitude * Math.PI / 180;
lat = coord.latitude * Geolib.TO_RAD;
lon = coord.longitude * Geolib.TO_RAD;

X += Math.cos(lat) * Math.cos(lon);
Y += Math.cos(lat) * Math.sin(lon);
Expand All @@ -448,8 +454,8 @@
lat = Math.atan2(Z, hyp);

return {
latitude: (lat * 180 / Math.PI).toFixed(6),
longitude: (lon * 180 / Math.PI).toFixed(6)
latitude: (lat * Geolib.TO_DEG).toFixed(6),
longitude: (lon * Geolib.TO_DEG).toFixed(6)
};

},
Expand Down Expand Up @@ -539,13 +545,13 @@
minLon = radLon - deltaLon;

if (minLon < MIN_LON_RAD) {
minLon += 2 * Math.PI;
minLon += Geolib.PI_X2;
}

maxLon = radLon + deltaLon;

if (maxLon > MAX_LON_RAD) {
maxLon -= 2 * Math.PI;
maxLon -= Geolib.PI_X2;
}

} else {
Expand Down Expand Up @@ -732,20 +738,20 @@
// difference latitude coords phi
var diffPhi = Math.log(
Math.tan(
this.latitude(destLL).toRad() / 2 + Math.PI / 4
this.latitude(destLL).toRad() / 2 + Geolib.PI_DIV4
) /
Math.tan(
this.latitude(originLL).toRad() / 2 + Math.PI / 4
this.latitude(originLL).toRad() / 2 + Geolib.PI_DIV4
)
);

// recalculate diffLon if it is greater than pi
if(Math.abs(diffLon) > Math.PI) {
if(diffLon > 0) {
diffLon = (2 * Math.PI - diffLon) * -1;
diffLon = (Geolib.PI_X2 - diffLon) * -1;
}
else {
diffLon = 2 * Math.PI + diffLon;
diffLon = Geolib.PI_X2 + diffLon;
}
}

Expand Down Expand Up @@ -1121,11 +1127,11 @@
var tmp = dec.toString().split('.');

var deg = Math.abs(tmp[0]);
var min = ('0.' + tmp[1])*60;
var min = ('0.' + (tmp[1] || 0))*60;
var sec = min.toString().split('.');

min = Math.floor(min);
sec = (('0.' + sec[1]) * 60).toFixed(2);
sec = (('0.' + (sec[1] || 0)) * 60).toFixed(2);

this.sexagesimal[dec] = (deg + '° ' + min + "' " + sec + '"');

Expand Down
6 changes: 3 additions & 3 deletions dist/geolib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"scripts": {
"test": "grunt travis --verbose"
},
"version": "2.0.17",
"version": "2.0.18",
"main": "dist/geolib.js"
}

0 comments on commit 2b54fa6

Please sign in to comment.