示例#1
0
                ?>
											</div>
											<div class="grid24-3col left marginleft email">
												<a href="mailto:<?php 
                $all_emails[] = $applicant->user_email;
                if ($now < $datetime) {
                    $future_app_emails[] = $applicant->user_email;
                } else {
                    if ($now >= $datetime) {
                        $past_app_emails[] = $applicant->user_email;
                    }
                }
                echo $applicant->user_login;
                ?>
"><?php 
                echo dot($applicant->user_email, 20);
                ?>
</a>
											</div>
											<div class="grid24-3col left marginleft alignright">
											<?php 
                if ($deposit_payer) {
                    ?>
												<span>N/A</span>
											<?php 
                } else {
                    ?>
												<form method="post" action="handle_ipn">
													<input type="hidden" value="Cash" name="txn_id" />
													<input type="hidden" value="Completed" name="payment_status" />
													<input type="hidden" value="Holding Deposit" name="item_name" />
示例#2
0
文件: render.php 项目: shish/travmap
function draw_village_marker($image, $entity, $village, $colour)
{
    global $server, $cx, $cy, $zx, $zy, $zz, $lines, $imageline, $dotsize;
    $vx = ($village['x'] - $zx) * $zz;
    $vy = -($village['y'] - $zy) * $zz;
    if ($lines) {
        $imageline($image, $entity['dx'], $entity['dy'], $cx + $vx, $cy + $vy, $colour);
    }
    $name = $village['name'];
    $owner = $village['owner'];
    $guild = $village['guild'];
    $x = $village['x'];
    $y = $village['y'];
    $pop = $village['population'];
    $cohash = (256 - $y) * 512 + ($x + 257);
    if ($zx != 0 || $zy != 0) {
        $dx = $x - $zx;
        $dy = $y - $zy;
        $dist = (int) sqrt($dx * $dx + $dy * $dy);
        $dfz = " ({$dist} away)";
    }
    $tip = svgentities("{$name} ({$x}, {$y}){$dfz}, {$pop}, ({$owner}, {$guild})");
    aimacustom($image, "<a xlink:href='http://{$server}/karte.php?z={$cohash}' xlink:title='{$tip}'>");
    dot($image, $cx + $vx, $cy + $vy, $colour, (log($pop + 1) + 1) * $dotsize);
    aimacustom($image, "</a>");
}
示例#3
0
function CrossTrackError($lon1, $lat1, $lon2, $lat2, $lon3, $lat3)
{
    $dot1 = dot($lon1, $lat1, $lon2, $lat2, $lon3, $lat3);
    if ($dot1 > 0) {
        list($dist_BD, $tmp1) = DistanceBearing($lat2, $lon2, $lat3, $lon3, 1, 0);
        return $dist_BD;
    }
    $dot2 = dot($lon2, $lat2, $lon1, $lat1, $lon3, $lat3);
    if ($dot2 > 0) {
        list($dist_AD, $crs_AD) = DistanceBearing($lat1, $lon1, $lat3, $lon3, 1, 1);
        return $dist_AD;
    }
    list($dist_AD, $crs_AD) = DistanceBearing($lat1, $lon1, $lat3, $lon3, 1, 1);
    $dist_AD /= RAD_TO_DEG * 111194.9267;
    $crs_AD *= DEG_TO_RAD;
    // list($dist_AB, $crs_AB)=  DistanceBearing($lat1, $lon1, $lat2, $lon2, 1,1);
    list($tmp1, $crs_AB) = DistanceBearing($lat1, $lon1, $lat2, $lon2, 0, 1);
    // DEBUG("a1",1,"dist_AB : $dist_AB dist_AD:$dist_AD ");
    //$dist_AB_m=  $dist_AB;
    //$dist_AB/= (RAD_TO_DEG * 111194.9267);
    $crs_AB *= DEG_TO_RAD;
    // $lat1 *= DEG_TO_RAD;
    // $lat2 *= DEG_TO_RAD;
    // $lat3 *= DEG_TO_RAD;
    // $lon1 *= DEG_TO_RAD;
    // $lon2 *= DEG_TO_RAD;
    // $lon3 *= DEG_TO_RAD;
    // double XTD; // cross track distance
    // double ATD; // along track distance
    //  The "along track distance", ATD, the distance from A along the
    //  course towards B to the point abeam D
    $sindist_AD = sin($dist_AD);
    $XTD = asin($sindist_AD * sin($crs_AD - $crs_AB));
    //$sinXTD = sin($XTD);
    //$ATD = asin(sqrt( $sindist_AD*$sindist_AD - $sinXTD*$sinXTD )/cos($XTD));
    /*
      if (lon4 && lat4) {
        IntermediatePoint(lon1, lat1, lon2, lat2, ATD, dist_AB,
    		      lon4, lat4);
      }
    */
    // units
    $XTD *= RAD_TO_DEG * 111194.9267;
    //$ATD *= (RAD_TO_DEG * 111194.9267);
    /*
    	//DEBUG("a1",1," XTD: $XTD , ATD: $ATD<BR>");
    	if ($ATD > $dist_AB_m ) {
    		list($dist_BD, $tmp1 )= DistanceBearing($lat2, $lon2, $lat3, $lon3, 1,0);
    		$XTD = min($dist_AD_m ,$dist_BD);
    		DEBUG("a1",1," special case: $dist_AD_m , $dist_BD<BR>");
    	} else {
    		DEBUG("a1",1,"XTD ($XTD) is ok ($ATD < $dist_AB_m )<BR>");
    	}
    */
    //   return abs($ATD);
    return abs($XTD);
}
示例#4
0
 /**
  * Flatten a multi-dimensional associative array with dots.
  *
  * @param  array   $array
  * @param  string  $prepend
  * @return array
  */
 function dot($array, $prepend = '')
 {
     $results = array();
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $results = array_merge($results, dot($value, $prepend . $key . '.'));
         } else {
             $results[$prepend . $key] = $value;
         }
     }
     return $results;
 }
示例#5
0
 function distance(&$ray)
 {
     $v = subtract($this->center, $ray["origin"]);
     $b = dot($v, $ray["direction"]);
     $disc = $b * $b - dot($v, $v) + $this->radius * $this->radius;
     if ($disc < 0.0) {
         return INFINITY;
     }
     // No intersection
     $d = sqrt($disc);
     $t1 = $b + $d;
     if ($t1 < 0.0) {
         return INFINITY;
     }
     $t2 = $b - $d;
     if ($t2 > 0.0) {
         return $t2;
     } else {
         return $t1;
     }
 }
示例#6
0
 public function line($line, $default = false, $log_errors = true)
 {
     $value = function_exists('dot') ? dot($this->language, $line, $default) : $this->dot($this->language, $line, $default);
     if ($value === null and $default === false and $log_errors === true) {
         log_message('error', 'Could not find the language line "' . $line . '"');
     }
     return $value;
 }
示例#7
0
function polylist2triangles(&$polylist, &$triangles)
{
    // Anzahl der input nodes
    $inputs = $polylist->xpath('./input');
    $icount = count($inputs);
    // übertrage input nodes
    for ($i = 0; $i < $icount; $i++) {
        $ti = $triangles->addChild('input');
        foreach ($inputs[$i]->attributes() as $attr_key => $attr_value) {
            $ti->addAttribute($attr_key, $attr_value);
        }
    }
    // vertex array
    $vinput = $polylist[0]->xpath('./input[@semantic="VERTEX"]')[0];
    $voffset = (int) $vinput['offset'];
    $vvertices = $polylist[0]->xpath('./../vertices[@id="' . substr((string) $vinput['source'], 1) . '"]')[0];
    $vsource = $polylist[0]->xpath('./../source[@id="' . substr((string) $vvertices->input['source'], 1) . '"]')[0];
    $vstride = (int) $vsource->technique_common->accessor['stride'];
    $verts = preg_split('/\\s+/', $vsource->float_array);
    $tp = [];
    for ($k = 0; $k < count($polylist); $k++) {
        $vcount = preg_split('/\\s+/', $polylist[$k]->vcount);
        $pp = preg_split('/\\s+/', $polylist[$k]->p);
        for ($i = 0, $l = count($vcount), $offset = 0; $i < $l; $i++) {
            $psize = (int) $vcount[$i];
            if ($psize == 3) {
                for ($j = 0, $m = $psize * $icount; $j < $m; $j++) {
                    array_push($tp, $pp[$offset + $j]);
                }
                $offset += $psize * $icount;
            } elseif ($psize == 4) {
                // test if polygon concave
                $pverts = [];
                for ($j = 0, $m = $psize; $j < $m; $j++) {
                    $vindex = $pp[$offset + $j * $icount] * $vstride;
                    $v = [];
                    for ($h = 0, $n = $vstride; $h < $n; $h++) {
                        array_push($v, $verts[$vindex + $h]);
                    }
                    array_push($pverts, $v);
                }
                $n0 = crossFromPoints($pverts[3], $pverts[0], $pverts[1]);
                $n1 = crossFromPoints($pverts[0], $pverts[1], $pverts[2]);
                $n2 = crossFromPoints($pverts[1], $pverts[2], $pverts[3]);
                $n3 = crossFromPoints($pverts[2], $pverts[3], $pverts[0]);
                $pstart = 0;
                if (dot($n3, $n0) < 0 && dot($n0, $n1) < 0) {
                    $pstart = 0;
                } elseif (dot($n0, $n1) < 0 && dot($n1, $n2) < 0) {
                    $pstart = 1 * $icount;
                } elseif (dot($n1, $n2) < 0 && dot($n2, $n3) < 0) {
                    $pstart = 2 * $icount;
                } elseif (dot($n2, $n3) < 0 && dot($n3, $n0) < 0) {
                    $pstart = 3 * $icount;
                }
                $plength = $psize * $icount;
                // reorder quad to triangles
                for ($j = 0, $m = (int) $plength * 0.75; $j < $m; $j++) {
                    array_push($tp, $pp[$offset + ($j + $pstart) % $plength]);
                }
                for ($j = 0, $m = (int) $plength * 0.25; $j < $m; $j++) {
                    array_push($tp, $pp[$offset + ($j + $pstart) % $plength]);
                }
                for ($j = (int) $plength * 0.5, $m = $plength; $j < $m; $j++) {
                    array_push($tp, $pp[$offset + ($j + $pstart) % $plength]);
                }
                $offset += $psize * $icount;
            }
        }
    }
    $triangles->addAttribute('count', count($tp) / (3 * $icount));
    $triangles->addChild('p', implode(' ', $tp));
}
示例#8
0
 /**
  * Get a config item and return a default value if it does not exist
  *
  * @package 	CodeIgniter
  * @author 		Kader Bouyakoub
  * @link 		@bkader <github>
  * @link 		@KaderBouyakoub <twitter>
  *
  * @param   mixed
  * @param   mixed
  * @return  mixed
  */
 public function get($item, $default = false)
 {
     return function_exists('dot') ? dot($this->config, $item, $default) : $this->dot($this->config, $item, $default);
 }
示例#9
0
function all_values_are()
{
    return curry2(function ($p, $list) {
        return is_array($list) && dot(f_and(), map($p), array_values($list));
    }, func_get_args());
}