php Programming Glossary: cos
Having trouble with PHPMailer http://stackoverflow.com/questions/13344239/having-trouble-with-phpmailer IsSMTP send via SMTP IsSMTP send via SMTP I commented it cos it gives an error mail SMTPAuth true turn on SMTP authentication..
PHP MySql and geolocation http://stackoverflow.com/questions/3606139/php-mysql-and-geolocation theta lon1 lon2 dist sin deg2rad lat1 sin deg2rad lat2 cos deg2rad lat1 cos deg2rad lat2 cos deg2rad theta dist acos dist.. dist sin deg2rad lat1 sin deg2rad lat2 cos deg2rad lat1 cos deg2rad lat2 cos deg2rad theta dist acos dist dist rad2deg dist.. lat1 sin deg2rad lat2 cos deg2rad lat1 cos deg2rad lat2 cos deg2rad theta dist acos dist dist rad2deg dist miles dist 60..
Get Nearest Places Google Maps (MySQL Spatial Data) http://stackoverflow.com/questions/4645490/get-nearest-places-google-maps-mysql-spatial-data given latitude and longitude. SELECT item1 item2 3959 acos cos radians 37 cos radians lat cos radians lng radians 122.. given latitude and longitude. SELECT item1 item2 3959 acos cos radians 37 cos radians lat cos radians lng radians 122 sin.. longitude. SELECT item1 item2 3959 acos cos radians 37 cos radians lat cos radians lng radians 122 sin radians 37 sin..
Geo-Search (Distance) in PHP/MySQL (Performance) http://stackoverflow.com/questions/5236921/geo-search-distance-in-php-mysql-performance bigger query where I join multiple tables SELECT id 6371 acos sin radians 52.4042924 sin radians lat cos radians 50.281852.. SELECT id 6371 acos sin radians 52.4042924 sin radians lat cos radians 50.281852 cos radians lat cos radians 2.504883 radians.. radians 52.4042924 sin radians lat cos radians 50.281852 cos radians lat cos radians 2.504883 radians lon AS dst FROM geoloc..
MySQL Great Circle Distance (Haversine formula) http://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula the range lat_range distance 69.172 lon_range abs distance cos details 0 69.172 min_lat number_format origin_lat lat_range.. instead of miles replace 3959 with 6371. SELECT id 3959 acos cos radians 37 cos radians lat cos radians lng radians 122 sin.. of miles replace 3959 with 6371. SELECT id 3959 acos cos radians 37 cos radians lat cos radians lng radians 122 sin radians..
Formulas to Calculate Geo Proximity http://stackoverflow.com/questions/2096385/formulas-to-calculate-geo-proximity and uses the following functions ASIN SQRT POWER SIN PI COS I've also seen variations from the same formula Spherical Law.. same formula Spherical Law of Cosines like this one 3956 ACOS COS RADIANS o_lat COS RADIANS d_lat COS RADIANS d_lon RADIANS.. formula Spherical Law of Cosines like this one 3956 ACOS COS RADIANS o_lat COS RADIANS d_lat COS RADIANS d_lon RADIANS o_lon..
How to efficiently find the closest locations nearby a given location http://stackoverflow.com/questions/3922404/how-to-efficiently-find-the-closest-locations-nearby-a-given-location @RlonA @RlonB SET @d SIN @deltaLat 2 SIN @deltaLat 2 COS @RlatA COS @RlatB SIN @deltaLon 2 SIN @deltaLon 2 RETURN 2 ASIN.. @RlonB SET @d SIN @deltaLat 2 SIN @deltaLat 2 COS @RlatA COS @RlatB SIN @deltaLon 2 SIN @deltaLon 2 RETURN 2 ASIN SQRT @d..
distance calculations in mysql queries http://stackoverflow.com/questions/3986556/distance-calculations-in-mysql-queries @RlonA @RlonB SET @d SIN @deltaLat 2 SIN @deltaLat 2 COS @RlatA COS @RlatB SIN @deltaLon 2 SIN @deltaLon 2 RETURN 2 ASIN.. @RlonB SET @d SIN @deltaLat 2 SIN @deltaLat 2 COS @RlatA COS @RlatB SIN @deltaLon 2 SIN @deltaLon 2 RETURN 2 ASIN SQRT @d..
select within 20 kilometers based on latitude/longitude http://stackoverflow.com/questions/6919661/select-within-20-kilometers-based-on-latitude-longitude this question SELECT FROM mytable m JOIN mytable mn ON ACOS COS RADIANS m.latitude COS RADIANS mn.latitude COS RADIANS mn.longitude.. question SELECT FROM mytable m JOIN mytable mn ON ACOS COS RADIANS m.latitude COS RADIANS mn.latitude COS RADIANS mn.longitude.. mytable m JOIN mytable mn ON ACOS COS RADIANS m.latitude COS RADIANS mn.latitude COS RADIANS mn.longitude RADIANS m.longitude..
PHP/MySQL: Select locations close to a given location from DB http://stackoverflow.com/questions/894713/php-mysql-select-locations-close-to-a-given-location-from-db latitude2 lat2 180 pi longitude2 long2 180 pi FORMULA e ARCCOS SIN Latitude1 SIN Latitude2 COS Latitude1 COS Latitude2 COS.. long2 180 pi FORMULA e ARCCOS SIN Latitude1 SIN Latitude2 COS Latitude1 COS Latitude2 COS Longitude2 Longitude1 EARTH_RADIUS.. FORMULA e ARCCOS SIN Latitude1 SIN Latitude2 COS Latitude1 COS Latitude2 COS Longitude2 Longitude1 EARTH_RADIUS distance acos..
|