forked from 0x2620/oxjs
misc updates to ox.js
This commit is contained in:
parent
d64e39c5b2
commit
2ef642fdeb
11 changed files with 136 additions and 93 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue