Loading eqc.diff 0 → 100644 +45 −0 Original line number Diff line number Diff line --- projCode/eqc.js 1970-01-01 01:00:00.000000000 +0100 +++ projCode/eqc.js 2008-06-11 21:16:31.000000000 +0200 @@ -0,0 +1,42 @@ +/* similar to equi.js FIXME proj4 uses eqc */ +Proj4js.Proj.eqc = { + init : function() { + + if(!this.x0) this.x0=0; + if(!this.y0) this.y0=0; + if(!this.lat0) this.lat0=0; + if(!this.long0) this.long0=0; + if(!this.lat_ts) this.lat_ts=0; + if (!this.title) this.title = "Equidistant Cylindrical (Plate Carre)"; + + this.rc= Math.cos(this.lat_ts); + }, + + + // forward equations--mapping lat,long to x,y + // ----------------------------------------------------------------- + forward : function(p) { + + var lon= p.x; + var lat= p.y; + + var dlon = Proj4js.common.adjust_lon(lon - this.long0); + var dlat = Proj4js.common.adjust_lat(lat - this.lat0 ); + p.x= this.x0 + (this.a*dlon*this.rc); + p.y= this.y0 + (this.a*dlat ); + return p; + }, + + // inverse equations--mapping x,y to lat/long + // ----------------------------------------------------------------- + inverse : function(p) { + + var x= p.x; + var y= p.y; + + p.x= Proj4js.common.adjust_lon(this.long0 + ((x - this.x0)/(this.a*this.rc))); + p.y= Proj4js.common.adjust_lat(this.lat0 + ((y - this.y0)/(this.a ))); + return p; + } + +}; Loading
eqc.diff 0 → 100644 +45 −0 Original line number Diff line number Diff line --- projCode/eqc.js 1970-01-01 01:00:00.000000000 +0100 +++ projCode/eqc.js 2008-06-11 21:16:31.000000000 +0200 @@ -0,0 +1,42 @@ +/* similar to equi.js FIXME proj4 uses eqc */ +Proj4js.Proj.eqc = { + init : function() { + + if(!this.x0) this.x0=0; + if(!this.y0) this.y0=0; + if(!this.lat0) this.lat0=0; + if(!this.long0) this.long0=0; + if(!this.lat_ts) this.lat_ts=0; + if (!this.title) this.title = "Equidistant Cylindrical (Plate Carre)"; + + this.rc= Math.cos(this.lat_ts); + }, + + + // forward equations--mapping lat,long to x,y + // ----------------------------------------------------------------- + forward : function(p) { + + var lon= p.x; + var lat= p.y; + + var dlon = Proj4js.common.adjust_lon(lon - this.long0); + var dlat = Proj4js.common.adjust_lat(lat - this.lat0 ); + p.x= this.x0 + (this.a*dlon*this.rc); + p.y= this.y0 + (this.a*dlat ); + return p; + }, + + // inverse equations--mapping x,y to lat/long + // ----------------------------------------------------------------- + inverse : function(p) { + + var x= p.x; + var y= p.y; + + p.x= Proj4js.common.adjust_lon(this.long0 + ((x - this.x0)/(this.a*this.rc))); + p.y= Proj4js.common.adjust_lat(this.lat0 + ((y - this.y0)/(this.a ))); + return p; + } + +};