Created
January 25, 2022 12:37
-
-
Save aditagusta/e5e76814ed090a03287bd86f9d7e257d to your computer and use it in GitHub Desktop.
Menghitung Jarak Antara 1 Titik Dengan Titik Lainnya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lokasi Awal | |
$my_latitude = $request->get('latitude'); | |
$my_longitude = $request->get('longitude'); | |
// Lokasi Tujuan | |
$my_latitude = $request->get('latitude'); | |
$my_longitude = $request->get('longitude'); | |
$distance = round((((acos(sin(($my_latitude*pi()/180)) * sin(($toko_latitude*pi()/180))+cos(($my_latitude*pi()/180)) * cos(($toko_latitude*pi()/180)) * cos((($my_longitude- $toko_longitude)*pi()/180))))*180/pi())*60*1.1515*1.609344), 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment