1 package com.gradoservice.proj4as.proj
\r
3 import com.gradoservice.proj4as.ProjPoint;
\r
4 import com.gradoservice.proj4as.ProjConstants;
\r
5 import com.gradoservice.proj4as.Datum;
\r
7 public class ProjEqc extends AbstractProjProjection
\r
9 public function ProjEqc(data:ProjParams)
\r
14 override public function init():void
\r
16 if(!this.x0) this.x0=0;
\r
17 if(!this.y0) this.y0=0;
\r
18 if(!this.lat0) this.lat0=0;
\r
19 if(!this.long0) this.long0=0;
\r
20 if(!this.lat_ts) this.lat_ts=0;
\r
21 if (!this.title) this.title = "Equidistant Cylindrical (Plate Carre)";
\r
22 this.rc= Math.cos(this.lat_ts);
\r
26 // forward equations--mapping lat,long to x,y
\r
27 // -----------------------------------------------------------------
\r
28 override public function forward(p:ProjPoint):ProjPoint
\r
30 var lon:Number= p.x;
\r
31 var lat:Number= p.y;
\r
33 var dlon:Number = ProjConstants.adjust_lon(lon - this.long0);
\r
34 var dlat:Number = ProjConstants.adjust_lat(lat - this.lat0 );
\r
35 p.x= this.x0 + (this.a*dlon*this.rc);
\r
36 p.y= this.y0 + (this.a*dlat );
\r
40 // inverse equations--mapping x,y to lat/long
\r
41 // -----------------------------------------------------------------
\r
42 override public function inverse(p:ProjPoint):ProjPoint
\r
47 p.x= ProjConstants.adjust_lon(this.long0 + ((x - this.x0)/(this.a*this.rc)));
\r
48 p.y= ProjConstants.adjust_lat(this.lat0 + ((y - this.y0)/(this.a )));
\r