Skip to content

Commit

Permalink
Fixed typos in README
Browse files Browse the repository at this point in the history
Added LICENSE file
Fixed whitespace in geoUtils.js
Fixed typos/clarified comments in geoUtils.js
  • Loading branch information
moshen committed Aug 26, 2010
1 parent a062034 commit 40ebaa4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
11 changes: 11 additions & 0 deletions LICENSE
@@ -0,0 +1,11 @@
Attribution 3.0 Unported
http://creativecommons.org/licenses/by/3.0/

"I offer these formul� & scripts for free use and adaptation as my contri
bution to the open-source info-sphere from which I have received so much.
You are welcome to re-use these scripts [under a simple attribution
license, without any warranty express or implied] provided solely that you
retain my copyright notice and a reference to this page."

(c) Chris Veness 2002-2010
http://www.movable-type.co.uk/scripts/latlong.html
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@ TODO:
* Add package.json

# Usage
var gu = require('geoUtils');
var gu = require('geoutils');

var point1 = new gu.LatLon(41.850033, -87.6500523);
Creates a lat/lon point for Chicago, Il
Expand Down
22 changes: 12 additions & 10 deletions lib/geoUtils.js
Expand Up @@ -3,8 +3,10 @@
/* - www.movable-type.co.uk/scripts/latlong.html */
/* */
/* Sample usage: */
/* var p1 = new LatLon(51.5136, -0.0983); */
/* var p2 = new LatLon(51.4778, -0.0015); */
/* */
/* var gu = require('geoutils'); */
/* var p1 = new gu.LatLon(51.5136, -0.0983); */
/* var p2 = new gu.LatLon(51.4778, -0.0015); */
/* var dist = p1.distanceTo(p2); // in km */
/* var brng = p1.bearingTo(p2); // in degrees clockwise from north */
/* ... etc */
Expand Down Expand Up @@ -159,10 +161,10 @@ LatLon.prototype.destinationPoint = function(brng, dist) {
*
* @param {LatLon} lat1, lon1: first point in decimal degrees
* @param {LatLon} lat2, lon2: second point in decimal degrees
* @returns {Number} distance in metres between points
* @returns {Number} distance in meters between points
*/
LatLon.prototype.distVincenty = function(destLatLon){
return distVincenty(this._lat, this._lon, destLatLon._lat, destLatLon._lon);
return distVincenty(this._lat, this._lon, destLatLon._lat, destLatLon._lon);
}

/**
Expand Down Expand Up @@ -340,8 +342,8 @@ LatLon.prototype.lon = function(format, dp) {
*/
LatLon.prototype.toString = function(format, dp) {
if (typeof format == 'undefined'){
return this._lat + ',' + this._lon;
}
return this._lat + ',' + this._lon;
}

return Geo.toLat(this._lat, format, dp) + ', ' + Geo.toLon(this._lon, format, dp);
}
Expand All @@ -357,7 +359,7 @@ var toRad = function(deg) {
return deg * Math.PI / 180;
}
Number.prototype.toRad = function(){
return toRad(this);
return toRad(this);
}
exports.toRad = toRad;

Expand All @@ -366,7 +368,7 @@ var toDeg = function(rad) {
return rad * 180 / Math.PI;
}
Number.prototype.toDeg = function(){
return toDeg(this);
return toDeg(this);
}
exports.toDeg = toDeg;

Expand Down Expand Up @@ -396,7 +398,7 @@ var toPrecisionFixed = function(in_num , precision) {
return sign + n;
}
Number.prototype.toPrecisionFixed = function(precision){
return toPrecisionFixed(this, precision);
return toPrecisionFixed(this, precision);
}
exports.toPrecisionFixed = toPrecisionFixed;

Expand Down Expand Up @@ -583,7 +585,7 @@ exports.toBrng = Geo.toBrng;
*
* @param {Number} lat1, lon1: first point in decimal degrees
* @param {Number} lat2, lon2: second point in decimal degrees
* @returns (Number} distance in metres between points
* @returns {Number} distance in metres between points
*/
var distVincenty = function(lat1, lon1, lat2, lon2) {
var a = 6378137, b = 6356752.314245, f = 1/298.257223563; // WGS-84 ellipsoid params
Expand Down

0 comments on commit 40ebaa4

Please sign in to comment.