Loading src/projCode/nzmg.js +39 −38 Original line number Diff line number Diff line Loading @@ -124,57 +124,57 @@ proj4.Proj.nzmg = { iterations: 1, init: function() { this.A = new Array(); this.A[1] = +0.6399175073; this.A = []; this.A[1] = 0.6399175073; this.A[2] = -0.1358797613; this.A[3] = +0.063294409; this.A[3] = 0.063294409; this.A[4] = -0.02526853; this.A[5] = +0.0117879; this.A[5] = 0.0117879; this.A[6] = -0.0055161; this.A[7] = +0.0026906; this.A[7] = 0.0026906; this.A[8] = -0.001333; this.A[9] = +0.00067; this.A[9] = 0.00067; this.A[10] = -0.00034; this.B_re = new Array(); this.B_im = new Array(); this.B_re[1] = +0.7557853228; this.B_im[1] = 0.0; this.B_re[2] = +0.249204646; this.B_im[2] = +0.003371507; this.B_re = []; this.B_im = []; this.B_re[1] = 0.7557853228; this.B_im[1] = 0; this.B_re[2] = 0.249204646; this.B_im[2] = 0.003371507; this.B_re[3] = -0.001541739; this.B_im[3] = +0.041058560; this.B_im[3] = 0.041058560; this.B_re[4] = -0.10162907; this.B_im[4] = +0.01727609; this.B_im[4] = 0.01727609; this.B_re[5] = -0.26623489; this.B_im[5] = -0.36249218; this.B_re[6] = -0.6870983; this.B_im[6] = -1.1651967; this.C_re = new Array(); this.C_im = new Array(); this.C_re[1] = +1.3231270439; this.C_im[1] = 0.0; this.C_re = []; this.C_im = []; this.C_re[1] = 1.3231270439; this.C_im[1] = 0; this.C_re[2] = -0.577245789; this.C_im[2] = -0.007809598; this.C_re[3] = +0.508307513; this.C_re[3] = 0.508307513; this.C_im[3] = -0.112208952; this.C_re[4] = -0.15094762; this.C_im[4] = +0.18200602; this.C_re[5] = +1.01418179; this.C_im[5] = +1.64497696; this.C_re[6] = +1.9660549; this.C_im[6] = +2.5127645; this.D = new Array(); this.D[1] = +1.5627014243; this.D[2] = +0.5185406398; this.C_im[4] = 0.18200602; this.C_re[5] = 1.01418179; this.C_im[5] = 1.64497696; this.C_re[6] = 1.9660549; this.C_im[6] = 2.5127645; this.D = []; this.D[1] = 1.5627014243; this.D[2] = 0.5185406398; this.D[3] = -0.03333098; this.D[4] = -0.1052906; this.D[5] = -0.0368594; this.D[6] = +0.007317; this.D[7] = +0.01220; this.D[8] = +0.00394; this.D[6] = 0.007317; this.D[7] = 0.01220; this.D[8] = 0.00394; this.D[9] = -0.0013; }, Loading @@ -183,6 +183,7 @@ proj4.Proj.nzmg = { long/lat in radians */ forward: function(p) { var n; var lon = p.x; var lat = p.y; Loading @@ -196,7 +197,7 @@ proj4.Proj.nzmg = { var d_phi_n = 1; // d_phi^0 var d_psi = 0; for (var n = 1; n <= 10; n++) { for (n = 1; n <= 10; n++) { d_phi_n = d_phi_n * d_phi; d_psi = d_psi + this.A[n] * d_phi_n; } Loading @@ -213,7 +214,7 @@ proj4.Proj.nzmg = { var z_re = 0; var z_im = 0; for (var n = 1; n <= 6; n++) { for (n = 1; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -234,7 +235,7 @@ proj4.Proj.nzmg = { New Zealand Map Grid Inverse - x/y to long/lat */ inverse: function(p) { var n; var x = p.x; var y = p.y; Loading @@ -253,7 +254,7 @@ proj4.Proj.nzmg = { var th_re = 0; var th_im = 0; for (var n = 1; n <= 6; n++) { for (n = 1; n <= 6; n++) { z_n_re1 = z_n_re * z_re - z_n_im * z_im; z_n_im1 = z_n_im * z_re + z_n_re * z_im; z_n_re = z_n_re1; Loading @@ -274,7 +275,7 @@ proj4.Proj.nzmg = { var num_re = z_re; var num_im = z_im; for (var n = 2; n <= 6; n++) { for (n = 2; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -287,7 +288,7 @@ proj4.Proj.nzmg = { th_n_im = 0; var den_re = this.B_re[1]; var den_im = this.B_im[1]; for (var n = 2; n <= 6; n++) { for (n = 2; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -308,7 +309,7 @@ proj4.Proj.nzmg = { var d_psi_n = 1; // d_psi^0 var d_phi = 0; for (var n = 1; n <= 9; n++) { for (n = 1; n <= 9; n++) { d_psi_n = d_psi_n * d_psi; d_phi = d_phi + this.D[n] * d_psi_n; } Loading Loading
src/projCode/nzmg.js +39 −38 Original line number Diff line number Diff line Loading @@ -124,57 +124,57 @@ proj4.Proj.nzmg = { iterations: 1, init: function() { this.A = new Array(); this.A[1] = +0.6399175073; this.A = []; this.A[1] = 0.6399175073; this.A[2] = -0.1358797613; this.A[3] = +0.063294409; this.A[3] = 0.063294409; this.A[4] = -0.02526853; this.A[5] = +0.0117879; this.A[5] = 0.0117879; this.A[6] = -0.0055161; this.A[7] = +0.0026906; this.A[7] = 0.0026906; this.A[8] = -0.001333; this.A[9] = +0.00067; this.A[9] = 0.00067; this.A[10] = -0.00034; this.B_re = new Array(); this.B_im = new Array(); this.B_re[1] = +0.7557853228; this.B_im[1] = 0.0; this.B_re[2] = +0.249204646; this.B_im[2] = +0.003371507; this.B_re = []; this.B_im = []; this.B_re[1] = 0.7557853228; this.B_im[1] = 0; this.B_re[2] = 0.249204646; this.B_im[2] = 0.003371507; this.B_re[3] = -0.001541739; this.B_im[3] = +0.041058560; this.B_im[3] = 0.041058560; this.B_re[4] = -0.10162907; this.B_im[4] = +0.01727609; this.B_im[4] = 0.01727609; this.B_re[5] = -0.26623489; this.B_im[5] = -0.36249218; this.B_re[6] = -0.6870983; this.B_im[6] = -1.1651967; this.C_re = new Array(); this.C_im = new Array(); this.C_re[1] = +1.3231270439; this.C_im[1] = 0.0; this.C_re = []; this.C_im = []; this.C_re[1] = 1.3231270439; this.C_im[1] = 0; this.C_re[2] = -0.577245789; this.C_im[2] = -0.007809598; this.C_re[3] = +0.508307513; this.C_re[3] = 0.508307513; this.C_im[3] = -0.112208952; this.C_re[4] = -0.15094762; this.C_im[4] = +0.18200602; this.C_re[5] = +1.01418179; this.C_im[5] = +1.64497696; this.C_re[6] = +1.9660549; this.C_im[6] = +2.5127645; this.D = new Array(); this.D[1] = +1.5627014243; this.D[2] = +0.5185406398; this.C_im[4] = 0.18200602; this.C_re[5] = 1.01418179; this.C_im[5] = 1.64497696; this.C_re[6] = 1.9660549; this.C_im[6] = 2.5127645; this.D = []; this.D[1] = 1.5627014243; this.D[2] = 0.5185406398; this.D[3] = -0.03333098; this.D[4] = -0.1052906; this.D[5] = -0.0368594; this.D[6] = +0.007317; this.D[7] = +0.01220; this.D[8] = +0.00394; this.D[6] = 0.007317; this.D[7] = 0.01220; this.D[8] = 0.00394; this.D[9] = -0.0013; }, Loading @@ -183,6 +183,7 @@ proj4.Proj.nzmg = { long/lat in radians */ forward: function(p) { var n; var lon = p.x; var lat = p.y; Loading @@ -196,7 +197,7 @@ proj4.Proj.nzmg = { var d_phi_n = 1; // d_phi^0 var d_psi = 0; for (var n = 1; n <= 10; n++) { for (n = 1; n <= 10; n++) { d_phi_n = d_phi_n * d_phi; d_psi = d_psi + this.A[n] * d_phi_n; } Loading @@ -213,7 +214,7 @@ proj4.Proj.nzmg = { var z_re = 0; var z_im = 0; for (var n = 1; n <= 6; n++) { for (n = 1; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -234,7 +235,7 @@ proj4.Proj.nzmg = { New Zealand Map Grid Inverse - x/y to long/lat */ inverse: function(p) { var n; var x = p.x; var y = p.y; Loading @@ -253,7 +254,7 @@ proj4.Proj.nzmg = { var th_re = 0; var th_im = 0; for (var n = 1; n <= 6; n++) { for (n = 1; n <= 6; n++) { z_n_re1 = z_n_re * z_re - z_n_im * z_im; z_n_im1 = z_n_im * z_re + z_n_re * z_im; z_n_re = z_n_re1; Loading @@ -274,7 +275,7 @@ proj4.Proj.nzmg = { var num_re = z_re; var num_im = z_im; for (var n = 2; n <= 6; n++) { for (n = 2; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -287,7 +288,7 @@ proj4.Proj.nzmg = { th_n_im = 0; var den_re = this.B_re[1]; var den_im = this.B_im[1]; for (var n = 2; n <= 6; n++) { for (n = 2; n <= 6; n++) { th_n_re1 = th_n_re * th_re - th_n_im * th_im; th_n_im1 = th_n_im * th_re + th_n_re * th_im; th_n_re = th_n_re1; Loading @@ -308,7 +309,7 @@ proj4.Proj.nzmg = { var d_psi_n = 1; // d_psi^0 var d_phi = 0; for (var n = 1; n <= 9; n++) { for (n = 1; n <= 9; n++) { d_psi_n = d_psi_n * d_psi; d_phi = d_phi + this.D[n] * d_psi_n; } Loading