/* Mollweide forward equations--mapping lat,long to x,y
----------------------------------------------------
771290
function forward$21(p) {

        /* Forward equations
         -----------------*/
        var lon = p.x;
        var lat = p.y;

        var delta_lon = adjust_lon(lon - this.long0);
        var theta = lat;
        var con = Math.PI * Math.sin(lat);

        /* Iterate using the Newton-Raphson method to find theta
         -----------------------------------------------------*/
        for (var i = 0; true; i++) {
            var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
            theta += delta_theta;
            if (Math.abs(delta_theta) < EPSLN) {
                break;
            }
        }
        theta /= 2;

        /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
         this is done here because of precision problems with "cos(theta)"
         --------------------------------------------------------------------------*/
        if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
            delta_lon = 0;
        }
        var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
        var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;

        p.x = x;
        p.y = y;
        return p;
    }
1063032
public function forward($p)
    {
        #$x,y,delta_lon;
        $lon = $p->x;
        $lat = $p->y;

        // Forward equations

        $lon = Common::adjust_lon( $lon - $this->long0 );

        if (isset($this->sphere)) {
            if (! $this->m) {
                $lat = $this->n != 1. ? asin( $this->n * sin( $lat ) ) : $lat;
            } else {
                $k = $this->n * sin( $lat );
                for ($i = Common::MAX_ITER; $i; --$i) {
                    $V = ($this->m * $lat + sin( $lat ) - $k) / ($this->m + cos( $lat ));
                    $lat -= $V;

                    if (abs( $V ) < Common::EPSLN) {
                        break;
                    }
                }
            }

            $x = $this->a * $this->C_x * $lon * ($this->m + cos( $lat ));
            $y = $this->a * $this->C_y * $lat;
        } else {
            $s = sin($lat);
            $c = cos($lat);

            $y = $this->a * Common::pj_mlfn($lat, $s, $c, $this->en);
            $x = $this->a * $lon * $c / sqrt(1.0 - $this->es * $s * $s);
        }

        $p->x = $x;
        $p->y = $y;

        return $p;
    }
957322
function(x, y) {
                this.forward.setPoint(x, y);
                //更新后置点
                if (this.smooth) {
                    this.updateAnother(this.forward, this.backward);
                }
                this.update();
                this.lastControlPointSet = this.forward;
                return this;
            }
384850
@Override
    public VarTensor forward() {
        MVecArray<VarTensor> xs = modIn.getOutput();
        y = new VarTensor(s, new VarSet(), s.one());
        for (int a=0; a<xs.dim(); a++) {
            VarTensor x = xs.get(a);
            y.prod(x);
        }
        return y;
    }
395855
function (latlngs, result, projectedBounds) {
		var flat = latlngs[0] instanceof L.LatLng,
		    len = latlngs.length,
		    i, ring;

		if (flat) {
			ring = [];
			for (i = 0; i < len; i++) {
				ring[i] = this._map.latLngToLayerPoint(latlngs[i]);
				projectedBounds.extend(ring[i]);
			}
			result.push(ring);
		} else {
			for (i = 0; i < len; i++) {
				this._projectLatlngs(latlngs[i], result, projectedBounds);
			}
		}
	}
806722
@Override
    public Tensor forward() {
        Tensor x = modIn.getOutput();
        y = new Tensor(s, 1);
        y.setValue(0, x.getSum());
        return y;
    }
533201
function forward$15(p) {
        var lon = p.x;
        var lat = p.y;
        var x, y;
        /* Forward equations
         -----------------*/
        var dlon = adjust_lon(lon - this.long0);
        if (this.sphere) {
            x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
            y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
        }
        else {
            var qs = qsfnz(this.e, Math.sin(lat));
            x = this.x0 + this.a * this.k0 * dlon;
            y = this.y0 + this.a * qs * 0.5 / this.k0;
        }

        p.x = x;
        p.y = y;
        return p;
    }
1089782
public void pointerMovedTo(double lat, double lon) {
            final Coordinate coordinate = new Coordinate(lat, lon);
            if (logger.isTraceEnabled()) {
                logger.trace("JS reports pointer move {}", coordinate);
            }
            fireEvent(new MapViewEvent(MapViewEvent.MAP_POINTER_MOVED, coordinate));
        }
1315925
public function forward($p)
    {
        //alert("ll2m coords : ".coords);
        $lon = $p->x;
        $lat = $p->y;

        // convert to radians
        if ($lat * Common::R2D > 90.0 &&
                  $lat * Common::R2D < -90.0 &&
                  $lon * Common::R2D > 180.0 &&
                  $lon * Common::R2D < -180.0
        ) {
            Proj4php::reportError( "merc:forward: llInputOutOfRange: " . $lon . " : " . $lat );
            return null;
        }

        if (abs( abs( $lat ) - Common::HALF_PI ) <= Common::EPSLN) {
            Proj4php::reportError( "merc:forward: ll2mAtPoles" );
            return null;
        } else {
            if ($this->sphere) {
                $x = $this->x0 + $this->a * $this->k0 * Common::adjust_lon( $lon - $this->long0 );
                $y = $this->y0 + $this->a * $this->k0 * log( tan( Common::FORTPI + 0.5 * $lat ) );
            } else {
                $sinphi = sin( lat );
                $ts = Common::tsfnz( $this->e, $lat, $sinphi );
                $x = $this->x0 + $this->a * $this->k0 * Common::adjust_lon( $lon - $this->long0 );
                $y = $this->y0 - $this->a * $this->k0 * log( $ts );
            }

            $p->x = $x;
            $p->y = $y;

            return $p;
        }
    }
922125
function toLatLng()
	{
		$wgs84 = new ReferenceEllipsoid(ReferenceEllipsoid::WGS84_MAJ, ReferenceEllipsoid::WGS84_MIN);

		$UTM_F0	 = 0.9996;
		$a = $wgs84->maj;
		$eSquared = $wgs84->ecc;
		$ePrimeSquared = $eSquared / (1.0 - $eSquared);
		$e1 = (1 - sqrt(1 - $eSquared)) / (1 + sqrt(1 - $eSquared));

		$x = $this->easting - 500000.0;;
		$y = $this->northing;

		$zoneNumber = $this->lngZone;
		$zoneLetter = $this->latZone;

		$longitudeOrigin = ($zoneNumber - 1.0) * 6.0 - 180.0 + 3.0;

		// Correct y for southern hemisphere
		if ((ord($zoneLetter) - ord("N")) < 0) {
			$y -= 10000000.0;
		}

		$m = $y / $UTM_F0;

		$mu = $m
			/ ($a
			* (1.0
				- $eSquared / 4.0
				- 3.0 * $eSquared * $eSquared / 64.0
				- 5.0
				* pow($eSquared, 3.0)
				/ 256.0));

		$phi1Rad = $mu
			+ (3.0 * $e1 / 2.0 - 27.0 * pow($e1, 3.0) / 32.0) * sin(2.0 * $mu)
			+ (21.0 * $e1 * $e1 / 16.0 - 55.0 * pow($e1, 4.0) / 32.0)
			* sin(4.0 * $mu)
			+ (151.0 * pow($e1, 3.0) / 96.0) * sin(6.0 * $mu);

		$n = $a / sqrt(1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad));

		$t = tan($phi1Rad) * tan($phi1Rad);
		$c = $ePrimeSquared * cos($phi1Rad) * cos($phi1Rad);

		$r = $a
			* (1.0 - $eSquared)
			/ pow(
			1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad),
			1.5);

		$d = $x / ($n * $UTM_F0);

		$latitude = ($phi1Rad
			- ($n * tan($phi1Rad) / $r)
			* ($d * $d / 2.0
				- (5.0
				+ (3.0 * $t)
				+ (10.0 * $c)
				- (4.0 * $c * $c)
				- (9.0 * $ePrimeSquared))
				* pow($d, 4.0)
				/ 24.0
				+ (61.0
				+ (90.0 * $t)
				+ (298.0 * $c)
				+ (45.0 * $t * $t)
				- (252.0 * $ePrimeSquared)
				- (3.0 * $c * $c))
				* pow($d, 6.0)
				/ 720.0)) * (180.0 / pi());

		$longitude = $longitudeOrigin + (($d
			- (1.0 + 2.0 * $t + $c) * pow($d, 3.0) / 6.0
			+ (5.0
			- (2.0 * $c)
			+ (28.0 * $t)
			- (3.0 * $c * $c)
			+ (8.0 * $ePrimeSquared)
			+ (24.0 * $t * $t))
			* pow($d, 5.0)
			/ 120.0)
			/ cos($phi1Rad)) * (180.0 / pi());

		return new LatLng($latitude, $longitude);
	}
1228718
public function forward($p)
    {
        $lon = $p->x;
        $lon = Common::adjust_lon( $lon - $this->long0 );
        $lat = $p->y;

        if ($this->sphere) {
            /*
            $sinphi;
            $cosphi;
            $coslam;
            $sinlam;
            */

            $sinphi = sin($lat);
            $cosphi = cos($lat);
            $coslam = cos($lon);
            $sinlam = sin($lon);

            switch($this->mode) {
                case $this->EQUIT:
                    $y = 1. + $cosphi * $coslam;
                    if (y <= Common::EPSLN) {
                        Proj4php::reportError("stere:forward:Equit");
                    }
                    $y = $this->akm1 / $y;
                    $x = $y * $cosphi * $sinlam;
                    $y *= $sinphi;
                    break;

                case $this->OBLIQ:
                    $y = 1. + $this->sinph0 * $sinphi + $this->cosph0 * $cosphi * $coslam;
                    if ($y <= Common::EPSLN) {
                        Proj4php::reportError("stere:forward:Obliq");
                    }
                    $y = $this->akm1 / $y;
                    $x = $y * $cosphi * $sinlam;
                    $y *= $this->cosph0 * $sinphi - $this->sinph0 * $cosphi * $coslam;
                    break;

                case $this->N_POLE:
                    $coslam = -$coslam;
                    $lat = -$lat;
                //Note  no break here so it conitnues through S_POLE

                case $this->S_POLE:
                    if (abs($lat - Common::HALF_PI) < $this->TOL) {
                        Proj4php::reportError("stere:forward:S_POLE");
                    }
                    $y = $this->akm1 * tan( Common::FORTPI + .5 * $lat );
                    $x = $sinlam * $y;
                    $y *= $coslam;
                    break;
            }
        } else {
            $coslam = cos($lon);
            $sinlam = sin($lon);
            $sinphi = sin($lat);

            if ($this->mode == $this->OBLIQ || $this->mode == $this->EQUIT) {
                $Xt = 2. * atan($this->ssfn_($lat, $sinphi, $this->e));
                $sinX = sin($Xt - Common::HALF_PI);
                $cosX = cos($Xt);
            }

            switch ($this->mode) {
                case $this->OBLIQ:
                    $A = $this->akm1 / ($this->cosX1 * (1. + $this->sinX1 * $sinX + $this->cosX1 * $cosX * $coslam));
                    $y = $A * ($this->cosX1 * $sinX - $this->sinX1 * $cosX * $coslam);
                    $x = $A * $cosX;
                    break;

                case $this->EQUIT:
                    $A = 2. * $this->akm1 / (1. + $cosX * $coslam);
                    $y = $A * $sinX;
                    $x = $A * $cosX;
                    break;

                case $this->S_POLE:
                    $lat = -$lat;
                    $coslam = - $coslam;
                    $sinphi = -$sinphi;

                case $this->N_POLE:
                    $x = $this->akm1 * Common::tsfnz( $this->e, $lat, $sinphi );
                    $y = - $x * $coslam;
                    break;
            }

            $x = $x * $sinlam;
        }

        $p->x = $x * $this->a + $this->x0;
        $p->y = $y * $this->a + $this->y0;

        return $p;
    }
270036
public void forward() {

        m_context.getSetupBean().prepareStep10();
        CmsSetupBean bean = m_context.getSetupBean();
        VaadinServletRequest request = (VaadinServletRequest)(VaadinRequest.getCurrent());
        String servletMapping = bean.getServletMapping();
        String openLink = null;

        if (!servletMapping.startsWith("/")) {
            servletMapping = "/" + servletMapping;
        }
        if (servletMapping.endsWith("/*")) {
            // usually a mapping must be in the form "/opencms/*", cut off all slashes
            servletMapping = servletMapping.substring(0, servletMapping.length() - 2);
        }
        openLink = request.getContextPath() + servletMapping + (bean.hasIndexHtml() ? "/index.html" : "/system/login");

        A_CmsUI.get().getPage().setLocation(openLink);
    }
961518
function(x, y) {
            var m0 = this.m[0],
                m1 = this.m[1],
                m2 = this.m[2],
                m3 = this.m[3],
                m4 = this.m[4],
                m5 = this.m[5],
                yt = ((m0 * (y - m5)) - (m1 * (x - m4))) / ((m0 * m3) - (m1 * m2)),
                xt = (x - m4 - (m2 * yt)) / m0;

            return this.translate(xt, yt);
        }
74701
function forward$12(p) {

        /* Forward equations
         -----------------*/
        var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
        var lam = p.x;
        var phi = p.y;

        lam = adjust_lon(lam - this.long0);
        if (this.sphere) {
            sinphi = Math.sin(phi);
            cosphi = Math.cos(phi);
            coslam = Math.cos(lam);
            if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
                y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
                if (y <= EPSLN) {
                    return null;
                }
                y = Math.sqrt(2 / y);
                x = y * cosphi * Math.sin(lam);
                y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
            }
            else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
                if (this.mode === this.N_POLE) {
                    coslam = -coslam;
                }
                if (Math.abs(phi + this.phi0) < EPSLN) {
                    return null;
                }
                y = FORTPI - phi * 0.5;
                y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));
                x = y * Math.sin(lam);
                y *= coslam;
            }
        }
        else {
            sinb = 0;
            cosb = 0;
            b = 0;
            coslam = Math.cos(lam);
            sinlam = Math.sin(lam);
            sinphi = Math.sin(phi);
            q = qsfnz(this.e, sinphi);
            if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
                sinb = q / this.qp;
                cosb = Math.sqrt(1 - sinb * sinb);
            }
            switch (this.mode) {
                case this.OBLIQ:
                    b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
                    break;
                case this.EQUIT:
                    b = 1 + cosb * coslam;
                    break;
                case this.N_POLE:
                    b = HALF_PI + phi;
                    q = this.qp - q;
                    break;
                case this.S_POLE:
                    b = phi - HALF_PI;
                    q = this.qp + q;
                    break;
            }
            if (Math.abs(b) < EPSLN) {
                return null;
            }
            switch (this.mode) {
                case this.OBLIQ:
                case this.EQUIT:
                    b = Math.sqrt(2 / b);
                    if (this.mode === this.OBLIQ) {
                        y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
                    }
                    else {
                        y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
                    }
                    x = this.xmf * b * cosb * sinlam;
                    break;
                case this.N_POLE:
                case this.S_POLE:
                    if (q >= 0) {
                        x = (b = Math.sqrt(q)) * sinlam;
                        y = coslam * ((this.mode === this.S_POLE) ? b : -b);
                    }
                    else {
                        x = y = 0;
                    }
                    break;
            }
        }

        p.x = this.a * x + this.x0;
        p.y = this.a * y + this.y0;
        return p;
    }
707919
public function forward($p)
    {
        $lon = $p->x;
        $lat = $p->y;

        $dlon = Common::adjust_lon( $lon - $this->long0 );
        $dlat = Common::adjust_lat( $lat - $this->lat0 );

        $p->x = $this->x0 + ($this->a * $dlon * $this->rc);
        $p->y = $this->y0 + ($this->a * $dlat );

        return $p;
    }
308623
public void latlonToEqui(double lat, double lon, Point2D_F64 rect) {
		rect.x = UtilAngle.wrapZeroToOne(lon / GrlConstants.PI2 + 0.5)*width;
		rect.y = UtilAngle.reflectZeroToOne(lat / GrlConstants.PI + 0.5)*(height-1);
	}
710739
public function forward($p)
    {
        $lon = $p->x;
        $lat = $p->y;

        $dlon = Common::adjust_lon( $lon - $this->long0 );
        $x = $this->x0 + $this->a * $dlon * cos( $this->lat_ts );
        $y = $this->y0 + $this->a * sin( $lat ) / cos( $this->lat_ts );

        /* Elliptical Forward Transform
          Not implemented due to a lack of a matchign inverse function
          {
          $Sin_Lat = sin(lat);
          $Rn = $this->a * (sqrt(1.0e0 - $this->es * Sin_Lat * Sin_Lat ));
          x = $this->x0 + $this->a * dlon * cos($this->lat_ts);
          y = $this->y0 + Rn * sin(lat) / cos($this->lat_ts);
          }
         */

        $p->x = $x;
        $p->y = $y;

        return $p;
    }