misc updates to ox.js

This commit is contained in:
rolux 2012-01-04 13:12:48 +05:30
commit 2ef642fdeb
11 changed files with 136 additions and 93 deletions

View file

@ -29,16 +29,15 @@
@*/
Ox.getArea = function(pointA, pointB) {
/*
area of a ring between two latitudes:
2 * PI * r^2 * abs(sin(lat0) - sin(lat1))
see http://mathforum.org/library/drmath/view/63767.html
*/
/*
2 * Math.PI *
Math.pow(Ox.EARTH_RADIUS, 2) *
Math.abs(Math.sin(Ox.rad(0)) - Math.sin(Ox.rad(1))) *
Math.abs(Ox.rad(0) - Ox.rad(1)) /
(2 * Math.PI)
area of a ring between two latitudes:
2 * PI * r^2 * abs(sin(latA) - sin(latB))
see http://mathforum.org/library/drmath/view/63767.html
=>
2 * Math.PI
* Math.pow(Ox.EARTH_RADIUS, 2)
* Math.abs(Math.sin(Ox.rad(latA)) - Math.sin(Ox.rad(latB)))
* Math.abs(Ox.rad(lngA) - Ox.rad(lngB))
/ (2 * Math.PI)
*/
if (Ox.crossesDateline(pointA, pointB)) {
pointB.lng += 360;