{"name":"@turf/distance","version":"3.5.2-alpha.d2c36ee7","keywords":["turf","distance","miles","km"],"author":{"name":"morganherlocker"},"license":"MIT","_id":"@turf/distance@3.5.2-alpha.d2c36ee7","maintainers":[{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"tmcw","email":"tom@macwright.org"}],"homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"c741e927267df7eefdb624c53858727c7f354c90","tarball":"http://registry-npm.ywwl.com/@turf/distance/download/@turf/distance-3.5.2-alpha.d2c36ee7.tgz","integrity":"sha512-0Lj5UqPri4sA6gb5ruPCECuXsK8aN3dhyxscKK9Ck7bXexpoS/Gk6iJHxVGGUly20sv+2wM6hmXfpKPHlgE7xw==","signatures":[{"sig":"MEYCIQDtULzBmu5nyhZxuC3dUdMvR1o+KiPmk/F8RWKEWXpV8gIhAOxDj7lIcXc8mnvwTzCPgr8wiZDmLZRN4ZvIrLFVZbD8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":3041,"noattachment":false,"key":"/@turf/distance/-/@turf/distance-3.5.2-alpha.d2c36ee7.tgz"},"main":"index.js","_from":".","_shasum":"c741e927267df7eefdb624c53858727c7f354c90","scripts":{"test":"tape test.js"},"_npmUser":{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"2.15.9","description":"turf distance module","directories":{},"_nodeVersion":"4.5.0","dependencies":{"@turf/helpers":"^3.5.2-alpha.d2c36ee7","@turf/invariant":"^3.5.2-alpha.d2c36ee7"},"devDependencies":{"tape":"^3.5.0","benchmark":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/distance-3.5.2-alpha.d2c36ee7.tgz_1478287973512_0.5485825201030821","host":"packages-12-west.internal.npmjs.com"},"readme":"# @turf/distance\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## distance\n\nCalculates the distance between two [points][1] in degrees, radians, miles, or kilometers.\nThis uses the [Haversine formula][2] to account for global curvature.\n\n### Parameters\n\n*   `from` **([Coord][3] | [Point][4])** origin point or coordinate\n*   `to` **([Coord][3] | [Point][4])** destination point or coordinate\n*   `options` **[Object][5]** Optional parameters (optional, default `{}`)\n\n    *   `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)\n\n### Examples\n\n```javascript\nvar from = turf.point([-75.343, 39.984]);\nvar to = turf.point([-75.534, 39.123]);\nvar options = {units: 'miles'};\n\nvar distance = turf.distance(from, to, options);\n\n//addToMap\nvar addToMap = [from, to];\nfrom.properties.distance = distance;\nto.properties.distance = distance;\n```\n\nReturns **[number][7]** distance between the two points\n\n[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2\n\n[2]: http://en.wikipedia.org/wiki/Haversine_formula\n\n[3]: https://tools.ietf.org/html/rfc7946#section-3.1.1\n\n[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String\n\n[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run \"yarn docs\" from the root of the turf project. -->\n\n---\n\nThis module is part of the [Turfjs project](https://turfjs.org/), an open source module collection dedicated to geographic algorithms. It is maintained in the [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create PRs and issues.\n\n### Installation\n\nInstall this single module individually:\n\n```sh\n$ npm install @turf/distance\n```\n\nOr install the all-encompassing @turf/turf module that includes all modules as functions:\n\n```sh\n$ npm install @turf/turf\n```\n","publish_time":1478287973735,"_cnpm_publish_time":1478287973735,"dist-tags":{"canary":"3.5.2-alpha.d2c36ee7","latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}