@ 2016-01-27T11:08:53Z <?php
$Fecha = "2016-01-27 11:34:19";
function CalcularTiempo($Timestamp){
$Segundos = strtotime('now') - strtotime($Timestamp);
return intval($Segundos);
}
function CalcularVelocidad($Distancia, $Tiempo){
return ($Distancia / $Tiempo) / 1000;
}
function CalcularDistancia($OrigenLat, $OrigenLon, $DestinoLat, $DestinoLon){
$R = 6371;
$dLat = ($DestinoLat - $OrigenLat) * (pi() / 180);
$dLon = ($DestinoLon - $OrigenLon) * (pi() / 180);
$a = sin($dLat / 2) * sin($dLat / 2) + cos($OrigenLat * (pi() / 180)) * cos($DestinoLat * (pi() / 180)) * sin($dLon / 2) * sin($dLon / 2);
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
return ($R * $c) * 1000;
}
$Tiempo = CalcularTiempo($Fecha);
$Distancia = CalcularDistancia(38.278096798610605,-0.6911851008339024,38.2788421664234,-0.6901980479164007);
$Velocidad = CalcularVelocidad($Distancia, $Tiempo);
echo $Velocidad;
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.31 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.12 , 8.0.14 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.4 , 8.3.6 5.761533279837E-5 Output for 8.3.5 Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
5.761533279837E-5 Output for 7.3.32 - 7.3.33 , 8.0.13 -7.839463315188E-5 preferences:dark mode live preview
225.51 ms | 401 KiB | 330 Q