/** Initialize Transverse Mercator projection */ public function init() { $this->e0 = Sourcemap_Proj::e0fn($this->es); $this->e1 = Sourcemap_Proj::e1fn($this->es); $this->e2 = Sourcemap_Proj::e2fn($this->es); $this->e3 = Sourcemap_Proj::e3fn($this->es); $this->ml0 = $this->a * Sourcemap_Proj::mlfn($this->e0, $this->e1, $this->e2, $this->e3, $this->lat0); }
public function init() { if (!$this->mode) { $this->mode = 0; } //chosen default mode $this->temp = $this->b / $this->a; $this->es = 1.0 - pow($this->temp, 2); $this->e = sqrt($this->es); $this->e0 = Sourcemap_Proj::e0fn($this->es); $this->e1 = Sourcemap_Proj::e1fn($this->es); $this->e2 = Sourcemap_Proj::e2fn($this->es); $this->e3 = Sourcemap_Proj::e3fn($this->es); $this->sinphi = sin($this->lat1); $this->cosphi = cos($this->lat1); $this->ms1 = Sourcemap_Proj::msfnz($this->e, $this->sinphi, $this->cosphi); $this->ml1 = Sourcemap_Proj::mlfn($this->e0, $this->e1, $this->e2, $this->e3, $this->lat1); /* format B ---------*/ if ($this->mode != 0) { if (abs($this->lat1 + $this->lat2) < Sourcemap_Proj::EPSLN) { throw new Exception("Equal latitudes."); } $this->sinphi = sin($this->lat2); $this->cosphi = cos($this->lat2); $this->ms2 = Sourcemap_Proj::msfnz($this->e, $this->sinphi, $this->cosphi); $this->ml2 = Sourcemap_Proj::mlfn($this->e0, $this->e1, $this->e2, $this->e3, $this->lat2); if (abs($this->lat1 - $this->lat2) >= Sourcemap_Proj::EPSLN) { $this->ns = ($this->ms1 - $this->ms2) / ($this->ml2 - $this->ml1); } else { $this->ns = $this->sinphi; } } else { $this->ns = $this->sinphi; } $this->g = $this->ml1 + $this->ms1 / $this->ns; $this->ml0 = Sourcemap_Proj::mlfn($this->e0, $this->e1, $this->e2, $this->e3, $this->lat0); $this->rh = $this->a * ($this->g - $this->ml0); }
public function init() { $temp; /* temporary variable */ if ($this->lat0 = 0) { $this->lat0 = 90; } //$this->lat0 ca /* Place parameters in static storage for common use -------------------------------------------------*/ $this->temp = $this->b / $this->a; $this->es = 1.0 - pow($this->temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles $this->e = sqrt($this->es); $this->e0 = Sourcemap_Proj::e0fn($this->es); $this->e1 = Sourcemap_Proj::e1fn($this->es); $this->e2 = Sourcemap_Proj::e2fn($this->es); $this->e3 = Sourcemap_Proj::e3fn($this->es); $this->ml0 = Sourcemap_Proj::mlfn($this->e0, $this->e1, $this->e2, $this->e3, $this->lat0); //si que des zeros le calcul ne se fait pas //if(!$this->ml0) {$this->ml0=0;} }