All Projects → jeroendesloovere → Distance

jeroendesloovere / Distance

Licence: mit
This Distance PHP class can calculate the distance between two latitude/longitude locations using Math functions in PHP. No external API's are called.

Labels

Projects that are alternatives of or similar to Distance

pubg mobile memory hacking
Pubg Mobile Emulator Gameloop Memory Hacking C++ Source Code. Ex: Name, Cords, Bones, Weapons, Items, Box, Drop, Aimbot etc.
Stars: ✭ 69 (+109.09%)
Mutual labels:  distance
Cheap Ruler
Fast approximations for common geodesic measurements 🌐
Stars: ✭ 334 (+912.12%)
Mutual labels:  distance
Dtw
DTW (Dynamic Time Warping) python module
Stars: ✭ 770 (+2233.33%)
Mutual labels:  distance
Multi-Face-Comparison
This repo is meant for backend API for face comparision and computer vision. It is built on python flask framework
Stars: ✭ 20 (-39.39%)
Mutual labels:  distance
similar-english-words
Give me a word and I’ll give you an array of words that differ by a single letter.
Stars: ✭ 25 (-24.24%)
Mutual labels:  distance
Pyemd
Fast EMD for Python: a wrapper for Pele and Werman's C++ implementation of the Earth Mover's Distance metric
Stars: ✭ 361 (+993.94%)
Mutual labels:  distance
NearestNeighborDescent.jl
Efficient approximate k-nearest neighbors graph construction and search in Julia
Stars: ✭ 34 (+3.03%)
Mutual labels:  distance
Foucluster
FouCluster compute distance among songs in frequency domains, and operate with clusters
Stars: ✭ 15 (-54.55%)
Mutual labels:  distance
Three Mesh Bvh
A BVH implementation to speed up raycasting against three.js meshes.
Stars: ✭ 302 (+815.15%)
Mutual labels:  distance
Geolocator
A utility for getting geo-location information via HTML5 and IP look-ups, geocoding, address look-ups, distance and durations, timezone information and more...
Stars: ✭ 598 (+1712.12%)
Mutual labels:  distance
TriangleMeshDistance
Header only, single file, simple and efficient C++11 library to compute the signed distance function (SDF) to a triangle mesh
Stars: ✭ 55 (+66.67%)
Mutual labels:  distance
Vincenty-Excel
Thaddeus Vincenty's Direct and Inverse formulae for geodesic calculations in Excel (distance, azimuth, latitude, longitude).
Stars: ✭ 29 (-12.12%)
Mutual labels:  distance
Stringmetric
🎯 String metrics and phonetic algorithms for Scala (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein).
Stars: ✭ 481 (+1357.58%)
Mutual labels:  distance
laravel-geoly
Perform fast and efficient radius searches on your Laravel Eloquent models.
Stars: ✭ 25 (-24.24%)
Mutual labels:  distance
Pas Coogeo
Pas-CooGeo is coordinate geometry library for Pascal.
Stars: ✭ 25 (-24.24%)
Mutual labels:  distance
Automated-Social-Distancing-Monitoring
automated social distancing monitoring system
Stars: ✭ 1 (-96.97%)
Mutual labels:  distance
Geolib
Zero dependency library to provide some basic geo functions
Stars: ✭ 3,675 (+11036.36%)
Mutual labels:  distance
Nlp xiaojiang
自然语言处理(nlp),小姜机器人(闲聊检索式chatbot),BERT句向量-相似度(Sentence Similarity),XLNET句向量-相似度(text xlnet embedding),文本分类(Text classification), 实体提取(ner,bert+bilstm+crf),数据增强(text augment, data enhance),同义句同义词生成,句子主干提取(mainpart),中文汉语短文本相似度,文本特征工程,keras-http-service调用
Stars: ✭ 954 (+2790.91%)
Mutual labels:  distance
Distance.js
🚗 Small Library for calculating distances between points.
Stars: ✭ 10 (-69.7%)
Mutual labels:  distance
Whereami
Uses WiFi signals 📶 and machine learning to predict where you are
Stars: ✭ 4,878 (+14681.82%)
Mutual labels:  distance

Distance class

Latest Stable Version License Build Status

Get distance between two locations using PHP. The distance is getting calculated based on latitude and logitude variables and without using any other external class.

Usage

Installing using Composer

When using Composer you can always load in the latest version.

{
    "require": {
        "jeroendesloovere/distance": "1.0.*"
    }
}

Check in Packagist.

Example

Setting our example data

use JeroenDesloovere\Distance\Distance;

// first location
$latitude1 = '50.8538510000';
$longitude1 = '3.3550450000';

// second location
$latitude2 = '50.8325600000';
$longitude2 = '3.4787650000';

Get distance between two locations

$distance = Distance::between(
    $latitude1,
    $longitude1,
    $latitude2,
    $longitude2
);

// dump data
echo 'Distance between the two locations = ' . $distance . ' km';

Get closest distance from location 1 to one of the two locations (2 and 3)

// third location
$latitude3 = '50.8865040000';
$longitude3 = '3.4320850000';

// define multiple items
$items = array(
    array(
        'title' => 'location 2',
        'latitude' => $latitude2,
        'longitude' => $longitude2
    ),
    array(
        'title' => 'location 3',
        'latitude' => $latitude3,
        'longitude' => $longitude3
    )
);

$distance = Distance::getClosest(
    $latitude1,
    $longitude1,
    $items
);

// dump data
echo 'The closest location to location 1 is ' . $distance['title'] . ' and the distance between them is ' . $distance['distance'] . ' km';

Documentation

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

Contributing

It would be great if you could help us improve this class. GitHub does a great job in managing collaboration by providing different tools, the only thing you need is a GitHub login.

  • Use Pull requests to add or update code
  • Issues for bug reporting or code discussions
  • Or regarding documentation and how-to's, check out Wiki More info on how to work with GitHub on help.github.com.

License

The module is licensed under MIT. In short, this license allows you to do everything as long as the copyright statement stays present.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].