{"id":15984886,"url":"https://github.com/divineomega/php-distance","last_synced_at":"2025-03-18T01:30:22.028Z","repository":{"id":56969671,"uuid":"158984597","full_name":"DivineOmega/php-distance","owner":"DivineOmega","description":"Allows for calculation of many types of distance between points","archived":false,"fork":false,"pushed_at":"2020-03-23T07:25:46.000Z","size":16,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-07T10:48:58.132Z","etag":null,"topics":["distance","euclidean-distance","haversine-distance","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-25T00:19:21.000Z","updated_at":"2022-01-12T14:19:39.000Z","dependencies_parsed_at":"2022-08-21T10:50:57.665Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/php-distance","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-distance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-distance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-distance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-distance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/php-distance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893849,"owners_count":20364918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distance","euclidean-distance","haversine-distance","php-library"],"created_at":"2024-10-08T02:11:05.233Z","updated_at":"2025-03-18T01:30:21.768Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Distance\n\n[![Build Status](https://travis-ci.org/DivineOmega/php-distance.svg?branch=master)](https://travis-ci.org/DivineOmega/php-distance)\n[![Coverage Status](https://coveralls.io/repos/github/DivineOmega/php-distance/badge.svg?branch=master)](https://coveralls.io/github/DivineOmega/php-distance?branch=master)\n[![Packagist](https://img.shields.io/packagist/dt/divineomega/php-distance.svg)](https://packagist.org/packages/divineomega/php-distance/stats)\n\nThe PHP Distance library allows for calculation of many types of distance between points.\n\n## Installation\n\nPHP Distance can be easily installed using Composer. Just run the following command from the root of your project.\n\n```\ncomposer require divineomega/php-distance\n```\n\nIf you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.\n\n## Usage\n\nSee the following code snippet that demonstates how to use this library.\n\n```php\n$a = new Point($x1, $y1);\n$b = new Point($x2, $y2);\n$c = new Point($x3, $y3, $z3); # Infinite dimensions supported by some distance types\n\n$distanceType = new Euclidean();\n$distanceType = new EuclideanSquare();\n$distanceType = new Haversine();\t# For GPS coordinates (latitude and longitude)\n\n$distance = (new Distance())\n\t\t-\u003etype(new Euclidean())\t# Type is optional, and defaults to Euclidean distance\n\t\t-\u003efrom($a)\n\t\t-\u003eto($b)\n\t\t-\u003eget();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fphp-distance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fphp-distance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fphp-distance/lists"}