本文整理匯總了PHP中map::ss2xy方法的典型用法代碼示例。如果您正苦於以下問題:PHP map::ss2xy方法的具體用法?PHP map::ss2xy怎麽用?PHP map::ss2xy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類map
的用法示例。
在下文中一共展示了map::ss2xy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: calcdist
function calcdist($sys1, $sys2)
{
//Pour avoir l'abscisse des coordonnées du système 1 [syst1 = 2456 ax = 2456%100]
//Pour avoir l'ordonée des coordonnées du système 1 [syst1 = 2456 ay = (2456-2456%100)/100]
list($syst1y, $syst1x) = map::ss2xy($sys1);
list($syst2y, $syst2x) = map::ss2xy($sys2);
return round(round(round(sqrt(carre($syst1x - $syst2x) + carre($syst1y - $syst2y)), 2), 1), 0);
}
示例2: path
public function path($CoordA, $CoordB)
{
list($sX, $sY) = map::ss2xy($CoordA);
list($sX2, $sY2) = map::ss2xy($CoordB);
$x1 = floor($this->tc * $sX - $this->tc / 2);
$y1 = floor($this->tc * ($sY + 1) - $this->tc / 2);
$x2 = floor($this->tc * $sX2 - $this->tc / 2);
$y2 = floor($this->tc * ($sY2 + 1) - $this->tc / 2);
imageline($this->im, $x1, $y1, $x2, $y2, $this->color);
}
示例3: img_dot
function img_dot($image, $coord, $clr)
{
$tc = map::getinstance()->taille / 100;
$td = floor($tc / 2);
$td = $td % 2 ? $td + 3 : $td + 2;
list($sX, $sY) = map::ss2xy($coord);
$x1 = floor($tc * $sX - $tc / 2);
$y1 = floor($tc * ($sY + 1) - $tc / 2);
imagefilledellipse($image, $x1, $y1, $td, $td, $clr);
}
示例4: GetListeCoorByRay
public function GetListeCoorByRay($SS, $max_dist)
{
// 4890 = 90:48
// 1 = 0001 = 1: 0
// 10000 = 100: 0
list($x, $y) = map::ss2xy($SS);
// Warn: x/y s'inverse ;)
$lst = array();
for ($a = 0 - $max_dist; $a <= 0 + $max_dist; $a++) {
for ($b = 0 - $max_dist; $b <= 0 + $max_dist; $b++) {
$y1 = $b + $y;
$x1 = $a + $x;
$out = $y1 * 100 + $x1;
if ($y1 < 0 || $y1 > 99) {
continue;
}
if ($x1 < 1 || $x1 > 100) {
continue;
}
if ($x1 == 100) {
$x1 = 0;
}
$out = $y1 * 100 + $x1;
if ($this->Calcul_Distance($SS, $out) < $max_dist) {
$lst[] = $out;
}
}
}
return $lst;
}