Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
function distance($detail,$city) {
$rows = "15";
$cols = "15";
$detail = explode ( ":", $detail );
$city = explode ( ":", $city );
$distance = array ();
if ($detail [0] == $city [0]) {
$distance ['fields'] = sectordistance ( $detail, $city );
} else {
if (($detail [0] - $city [0]) >= 10) {
$distance ['sectors'] = floor ( ( $detail [0] - $city [0] ) / 10 ) + substr ( ( $detail [0] - $city [0] ) / 10, -1 );
$distance ['fields'] += $distance ['sectors'] * 15;
} else {
$distance ['sectors'] = $detail [0] - $city [0];
$distance ['fields'] += $distance ['sectors'] * 15;
}
$distance ['fields'] += sectordistance ( $detail, $city );
}
return show ( fieldduration ) * $distance ['fields'];
}
function sectordistance($detail,$city) {
if ($detail [1] == $city [1]) {
if ($detail [2] == $city [2]) {
return (int) 0;
} else {
return (int) ( $detail [2] - $city [2] );
}
} else {
if ($detail [2] == $city [2]) {
return (int) ( $detail [1] - $city [1] );
} else {
return (int) ( ( $detail [1] - $city [1] ) + ( $detail [2] - $city [2] ) );
}
}
}
function distance($detail,$city) {
$detail = explode ( ":", $detail );
$city = explode ( ":", $city );
$distance = array ();
if ($detail [0] == $city [0]) {
$distance ['fields'] = sectordistance ( $detail, $city );
} else {
$distance ['sectors'] = floor ( ( abs ( $detail [0] - $city [0] ) ) / 10 ) + substr ( ( abs ( $detail [0] - $city [0] ) ) / 10, -1 );
$distance ['fields'] = ( $distance ['sectors'] * 15 ) + sectordistance ( $detail, $city );
}
return show ( fieldduration ) * $distance ['fields'];
}
function sectordistance($detail,$city) {
if ($detail [1] == $city [1]) {
if ($detail [2] == $city [2]) {
return 0;
} else {
return abs ( $detail [2] - $city [2] );
}
} else {
if ($detail [2] == $city [2]) {
return abs ( $detail [1] - $city [1] );
} else {
return abs ( $detail [1] - $city [1] ) + abs ( $detail [2] - $city [2] );
}
}
}
function SektorEntfernung($x, $y)
{
// Koordinaten aufschlüsseln
$a = explode(":", $x);
$b = explode(":", $y);
// Sektorenentfernung wiedergeben
return abs($a[0] - $b[0]);
}
$s1 = "44:0:0";
$s2 = "12:0:0";
echo SektorEntfernung($s1, $s2);
32