<?php
/**
* Author: Archie, Disono (disono.apd@gmail.com)
*/
namespace App\Models;
class Route
{
/**
* Distance
* Returns the distance in kilometers, assuming earth radius of 6,371 km.
*
* @param $lat
* @param $lng
*
* @return string
*/
private static function distanceStart($lat, $lng)
{
return '6371 * 2 * ASIN(SQRT(POWER(SIN((' . $lat .
' - ABS(table_name.lat)) * PI() / 180 / 2), 2) + COS(' . $lat .
' * PI() / 180) * COS(ABS(table_name.lat) * PI() / 180) * POWER(SIN((' . $lng .
' - table_name.lng) * PI() / 180 / 2), 2)))';
}
}
Last active
April 17, 2018 03:06
-
-
Save disono/f2882f17b36cc0434cf7aab3dd6d852b to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment