Loading src/projCode/cass.js +9 −9 Original line number Diff line number Diff line Loading @@ -60,11 +60,11 @@ proj4.Proj.cass = { var tl = Math.tan(phi) * Math.tan(phi); var al = lam * Math.cos(phi); var asq = al * al; var cl = this.es * cosphi * cosphi / (1.0 - this.es); var cl = this.es * cosphi * cosphi / (1 - this.es); var ml = this.a * proj4.common.mlfn(this.e0, this.e1, this.e2, this.e3, phi); x = nl * al * (1.0 - asq * tl * (1.0 / 6.0 - (8.0 - tl + 8.0 * cl) * asq / 120.0)); y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5.0 - tl + 6.0 * cl) * asq / 24.0); x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120)); y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24); } Loading Loading @@ -95,19 +95,19 @@ proj4.Proj.cass = { if (Math.abs(Math.abs(phi1) - proj4.common.HALF_PI) <= proj4.common.EPSLN) { p.x = this.long0; p.y = proj4.common.HALF_PI; if (y < 0.0) { p.y *= -1.0; if (y < 0) { p.y *= -1; } return p; } var nl1 = proj4.common.gN(this.a, this.e, Math.sin(phi1)); var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1.0 - this.es); var tl1 = Math.pow(Math.tan(phi1), 2.0); var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es); var tl1 = Math.pow(Math.tan(phi1), 2); var dl = x * this.a / nl1; var dsq = dl * dl; phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1.0 + 3.0 * tl1) * dl * dl / 24.0); lam = dl * (1.0 - dsq * (tl1 / 3.0 + (1.0 + 3.0 * tl1) * tl1 * dsq / 15.0)) / Math.cos(phi1); phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24); lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1); } Loading src/projCode/cea.js +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ proj4.Proj.cea = { lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts)); } else { lat = proj4.common.iqsfnz(this.e, 2.0 * p.y * this.k0 / this.a); lat = proj4.common.iqsfnz(this.e, 2 * p.y * this.k0 / this.a); lon = proj4.common.adjust_lon(this.long0 + p.x / (this.a * this.k0)); } Loading src/projCode/gauss.js +4 −4 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ proj4.Proj.gauss = { var sphi = Math.sin(this.lat0); var cphi = Math.cos(this.lat0); cphi *= cphi; this.rc = Math.sqrt(1.0 - this.es) / (1.0 - this.es * sphi * sphi); this.C = Math.sqrt(1.0 + this.es * cphi * cphi / (1.0 - this.es)); this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi); this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es)); this.phic0 = Math.asin(sphi / this.C); this.ratexp = 0.5 * this.C * this.e; this.K = Math.tan(0.5 * this.phic0 + proj4.common.FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * sphi, this.ratexp)); Loading @@ -15,7 +15,7 @@ proj4.Proj.gauss = { var lon = p.x; var lat = p.y; p.y = 2.0 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * Math.sin(lat), this.ratexp)) - proj4.common.HALF_PI; p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * Math.sin(lat), this.ratexp)) - proj4.common.HALF_PI; p.x = this.C * lon; return p; }, Loading @@ -26,7 +26,7 @@ proj4.Proj.gauss = { var lat = p.y; var num = Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI) / this.K, 1 / this.C); for (var i = proj4.common.MAX_ITER; i > 0; --i) { lat = 2.0 * Math.atan(num * proj4.common.srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - proj4.common.HALF_PI; lat = 2 * Math.atan(num * proj4.common.srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - proj4.common.HALF_PI; if (Math.abs(lat - p.y) < DEL_TOL){ break; } Loading src/projCode/gnom.js +2 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ proj4.Proj.gnom = { coslon = Math.cos(dlon); g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; ksp = 1.0; ksp = 1; if ((g > 0) || (Math.abs(g) <= proj4.common.EPSLN)) { x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g; y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g; Loading Loading @@ -106,7 +106,7 @@ proj4.Proj.gnom = { } else { lat = this.phic0; lon = 0.0; lon = 0; } p.x = lon; Loading src/projCode/gstmerc.js +6 −6 Original line number Diff line number Diff line Loading @@ -3,14 +3,14 @@ proj4.Proj.gstmerc = { // array of: a, b, lon0, lat0, k0, x0, y0 var temp = this.b / this.a; this.e = Math.sqrt(1.0 - temp * temp); this.e = Math.sqrt(1 - temp * temp); this.lc = this.long0; this.rs = Math.sqrt(1.0 + this.e * this.e * Math.pow(Math.cos(this.lat0), 4.0) / (1.0 - this.e * this.e)); this.rs = Math.sqrt(1 + this.e * this.e * Math.pow(Math.cos(this.lat0), 4) / (1 - this.e * this.e)); var sinz = Math.sin(this.lat0); var pc = Math.asin(sinz / this.rs); var sinzpc = Math.sin(pc); this.cp = proj4.common.latiso(0.0, pc, sinzpc) - this.rs * proj4.common.latiso(this.e, this.lat0, sinz); this.n2 = this.k0 * this.a * Math.sqrt(1.0 - this.e * this.e) / (1.0 - this.e * this.e * sinz * sinz); this.cp = proj4.common.latiso(0, pc, sinzpc) - this.rs * proj4.common.latiso(this.e, this.lat0, sinz); this.n2 = this.k0 * this.a * Math.sqrt(1 - this.e * this.e) / (1 - this.e * this.e * sinz * sinz); this.xs = this.x0; this.ys = this.y0 - this.n2 * pc; Loading @@ -30,7 +30,7 @@ proj4.Proj.gstmerc = { var L = this.rs * (lon - this.lc); var Ls = this.cp + (this.rs * proj4.common.latiso(this.e, lat, Math.sin(lat))); var lat1 = Math.asin(Math.sin(L) / proj4.common.cosh(Ls)); var Ls1 = proj4.common.latiso(0.0, lat1, Math.sin(lat1)); var Ls1 = proj4.common.latiso(0, lat1, Math.sin(lat1)); p.x = this.xs + (this.n2 * Ls1); p.y = this.ys + (this.n2 * Math.atan(proj4.common.sinh(Ls) / Math.cos(L))); return p; Loading @@ -45,7 +45,7 @@ proj4.Proj.gstmerc = { var L = Math.atan(proj4.common.sinh((x - this.xs) / this.n2) / Math.cos((y - this.ys) / this.n2)); var lat1 = Math.asin(Math.sin((y - this.ys) / this.n2) / proj4.common.cosh((x - this.xs) / this.n2)); var LC = proj4.common.latiso(0.0, lat1, Math.sin(lat1)); var LC = proj4.common.latiso(0, lat1, Math.sin(lat1)); p.x = this.lc + L / this.rs; p.y = proj4.common.invlatiso(this.e, (LC - this.cp) / this.rs); return p; Loading Loading
src/projCode/cass.js +9 −9 Original line number Diff line number Diff line Loading @@ -60,11 +60,11 @@ proj4.Proj.cass = { var tl = Math.tan(phi) * Math.tan(phi); var al = lam * Math.cos(phi); var asq = al * al; var cl = this.es * cosphi * cosphi / (1.0 - this.es); var cl = this.es * cosphi * cosphi / (1 - this.es); var ml = this.a * proj4.common.mlfn(this.e0, this.e1, this.e2, this.e3, phi); x = nl * al * (1.0 - asq * tl * (1.0 / 6.0 - (8.0 - tl + 8.0 * cl) * asq / 120.0)); y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5.0 - tl + 6.0 * cl) * asq / 24.0); x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120)); y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24); } Loading Loading @@ -95,19 +95,19 @@ proj4.Proj.cass = { if (Math.abs(Math.abs(phi1) - proj4.common.HALF_PI) <= proj4.common.EPSLN) { p.x = this.long0; p.y = proj4.common.HALF_PI; if (y < 0.0) { p.y *= -1.0; if (y < 0) { p.y *= -1; } return p; } var nl1 = proj4.common.gN(this.a, this.e, Math.sin(phi1)); var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1.0 - this.es); var tl1 = Math.pow(Math.tan(phi1), 2.0); var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es); var tl1 = Math.pow(Math.tan(phi1), 2); var dl = x * this.a / nl1; var dsq = dl * dl; phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1.0 + 3.0 * tl1) * dl * dl / 24.0); lam = dl * (1.0 - dsq * (tl1 / 3.0 + (1.0 + 3.0 * tl1) * tl1 * dsq / 15.0)) / Math.cos(phi1); phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24); lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1); } Loading
src/projCode/cea.js +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ proj4.Proj.cea = { lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts)); } else { lat = proj4.common.iqsfnz(this.e, 2.0 * p.y * this.k0 / this.a); lat = proj4.common.iqsfnz(this.e, 2 * p.y * this.k0 / this.a); lon = proj4.common.adjust_lon(this.long0 + p.x / (this.a * this.k0)); } Loading
src/projCode/gauss.js +4 −4 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ proj4.Proj.gauss = { var sphi = Math.sin(this.lat0); var cphi = Math.cos(this.lat0); cphi *= cphi; this.rc = Math.sqrt(1.0 - this.es) / (1.0 - this.es * sphi * sphi); this.C = Math.sqrt(1.0 + this.es * cphi * cphi / (1.0 - this.es)); this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi); this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es)); this.phic0 = Math.asin(sphi / this.C); this.ratexp = 0.5 * this.C * this.e; this.K = Math.tan(0.5 * this.phic0 + proj4.common.FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * sphi, this.ratexp)); Loading @@ -15,7 +15,7 @@ proj4.Proj.gauss = { var lon = p.x; var lat = p.y; p.y = 2.0 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * Math.sin(lat), this.ratexp)) - proj4.common.HALF_PI; p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI), this.C) * proj4.common.srat(this.e * Math.sin(lat), this.ratexp)) - proj4.common.HALF_PI; p.x = this.C * lon; return p; }, Loading @@ -26,7 +26,7 @@ proj4.Proj.gauss = { var lat = p.y; var num = Math.pow(Math.tan(0.5 * lat + proj4.common.FORTPI) / this.K, 1 / this.C); for (var i = proj4.common.MAX_ITER; i > 0; --i) { lat = 2.0 * Math.atan(num * proj4.common.srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - proj4.common.HALF_PI; lat = 2 * Math.atan(num * proj4.common.srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - proj4.common.HALF_PI; if (Math.abs(lat - p.y) < DEL_TOL){ break; } Loading
src/projCode/gnom.js +2 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ proj4.Proj.gnom = { coslon = Math.cos(dlon); g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon; ksp = 1.0; ksp = 1; if ((g > 0) || (Math.abs(g) <= proj4.common.EPSLN)) { x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g; y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g; Loading Loading @@ -106,7 +106,7 @@ proj4.Proj.gnom = { } else { lat = this.phic0; lon = 0.0; lon = 0; } p.x = lon; Loading
src/projCode/gstmerc.js +6 −6 Original line number Diff line number Diff line Loading @@ -3,14 +3,14 @@ proj4.Proj.gstmerc = { // array of: a, b, lon0, lat0, k0, x0, y0 var temp = this.b / this.a; this.e = Math.sqrt(1.0 - temp * temp); this.e = Math.sqrt(1 - temp * temp); this.lc = this.long0; this.rs = Math.sqrt(1.0 + this.e * this.e * Math.pow(Math.cos(this.lat0), 4.0) / (1.0 - this.e * this.e)); this.rs = Math.sqrt(1 + this.e * this.e * Math.pow(Math.cos(this.lat0), 4) / (1 - this.e * this.e)); var sinz = Math.sin(this.lat0); var pc = Math.asin(sinz / this.rs); var sinzpc = Math.sin(pc); this.cp = proj4.common.latiso(0.0, pc, sinzpc) - this.rs * proj4.common.latiso(this.e, this.lat0, sinz); this.n2 = this.k0 * this.a * Math.sqrt(1.0 - this.e * this.e) / (1.0 - this.e * this.e * sinz * sinz); this.cp = proj4.common.latiso(0, pc, sinzpc) - this.rs * proj4.common.latiso(this.e, this.lat0, sinz); this.n2 = this.k0 * this.a * Math.sqrt(1 - this.e * this.e) / (1 - this.e * this.e * sinz * sinz); this.xs = this.x0; this.ys = this.y0 - this.n2 * pc; Loading @@ -30,7 +30,7 @@ proj4.Proj.gstmerc = { var L = this.rs * (lon - this.lc); var Ls = this.cp + (this.rs * proj4.common.latiso(this.e, lat, Math.sin(lat))); var lat1 = Math.asin(Math.sin(L) / proj4.common.cosh(Ls)); var Ls1 = proj4.common.latiso(0.0, lat1, Math.sin(lat1)); var Ls1 = proj4.common.latiso(0, lat1, Math.sin(lat1)); p.x = this.xs + (this.n2 * Ls1); p.y = this.ys + (this.n2 * Math.atan(proj4.common.sinh(Ls) / Math.cos(L))); return p; Loading @@ -45,7 +45,7 @@ proj4.Proj.gstmerc = { var L = Math.atan(proj4.common.sinh((x - this.xs) / this.n2) / Math.cos((y - this.ys) / this.n2)); var lat1 = Math.asin(Math.sin((y - this.ys) / this.n2) / proj4.common.cosh((x - this.xs) / this.n2)); var LC = proj4.common.latiso(0.0, lat1, Math.sin(lat1)); var LC = proj4.common.latiso(0, lat1, Math.sin(lat1)); p.x = this.lc + L / this.rs; p.y = proj4.common.invlatiso(this.e, (LC - this.cp) / this.rs); return p; Loading