{"_id":"@mapbox/point-geometry","_rev":"243-9687a189e8b2f0c40b9e1b8562f2322b","name":"@mapbox/point-geometry","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@mapbox/point-geometry","version":"0.1.0","keywords":["point","geometry","primitive"],"author":{"name":"Tom MacWright"},"license":"ISC","_id":"@mapbox/point-geometry@0.1.0","maintainers":[{"name":"flippmoke","email":"flippmoke@gmail.com"}],"homepage":"https://github.com/mapbox/point-geometry","bugs":{"url":"https://github.com/mapbox/point-geometry/issues"},"dist":{"shasum":"8a83f9335c7860effa2eeeca254332aa0aeed8f2","tarball":"https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz","integrity":"sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==","signatures":[{"sig":"MEQCIDTnfsnlpj/Y9dPJU4jnPDWj71912PxZKa41VC0CmbipAiBXgz8mtdeoP/VBx6wC8KmSGDp8Mxgdf1LM/EBsnqFpyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"8a83f9335c7860effa2eeeca254332aa0aeed8f2","gitHead":"168c4666af9167f11d40c4718b05729d98046834","scripts":{"cov":"istanbul cover test.js && coveralls < ./coverage/lcov.info","doc":"dox -r < index.js | doxme --readme > README.md","test":"tape test.js"},"_npmUser":{"name":"flippmoke","email":"flippmoke@gmail.com"},"repository":{"url":"git+ssh://git@github.com/mapbox/point-geometry.git","type":"git"},"_npmVersion":"2.15.11","description":"a point geometry with transforms","directories":{},"_nodeVersion":"4.8.2","devDependencies":{"dox":"^0.6.1","tape":"~2.13.3","doxme":"^1.8.2","istanbul":"~0.2.11","coveralls":"~2.10.1"},"_npmOperationalInternal":{"tmp":"tmp/point-geometry-0.1.0.tgz_1492794459278_0.23473566002212465","host":"packages-18-east.internal.npmjs.com"}},"1.0.0":{"name":"@mapbox/point-geometry","version":"1.0.0","keywords":["point","geometry","primitive"],"author":{"name":"Tom MacWright"},"license":"ISC","_id":"@mapbox/point-geometry@1.0.0","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"homepage":"https://github.com/mapbox/point-geometry","bugs":{"url":"https://github.com/mapbox/point-geometry/issues"},"dist":{"shasum":"5e597e37f57951999f64f9f512afead9ad4b1c16","tarball":"https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.0.0.tgz","fileCount":5,"integrity":"sha512-1EPbCrZvs+eBayaMcPeDmwsbgG/b7vQxtYlzLI/5dA2SHctbUxFr13OE4+AdozoF8EtvbaFcfQIzWetOfooz/w==","signatures":[{"sig":"MEUCIE/bZfqgQGl23+hIelqxAMPcDp0vq6EMeRPAw+IXcOp+AiEA5SY85DILzU9E2tS1x+V33L4LFKGTny4aOdBsvqmrJMU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23542},"main":"index.js","type":"module","types":"index.d.ts","exports":"./index.js","gitHead":"ebc356d59effba58e79c1a0c5539658ab1110d15","scripts":{"cov":"node --test --experimental-test-coverage","doc":"documentation readme index.js --section=API --markdown-toc=false","lint":"eslint --fix index.js test.js","test":"tsc && node test.js","pretest":"npm run lint"},"_npmUser":{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},"repository":{"url":"git+ssh://git@github.com/mapbox/point-geometry.git","type":"git"},"_npmVersion":"10.5.1","description":"a point geometry with transforms","directories":{},"_nodeVersion":"20.12.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.6.0","typescript":"^5.5.3","documentation":"^14.0.3","eslint-config-mourner":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/point-geometry_1.0.0_1720677937293_0.43414735907075586","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@mapbox/point-geometry","version":"1.1.0","description":"a point geometry with transforms","main":"index.js","type":"module","exports":"./index.js","types":"index.d.ts","scripts":{"lint":"eslint --fix index.js test.js","pretest":"npm run lint","test":"tsc && node test.js","doc":"documentation readme index.js --section=API --markdown-toc=false","cov":"node --test --experimental-test-coverage"},"repository":{"type":"git","url":"git+ssh://git@github.com/mapbox/point-geometry.git"},"keywords":["point","geometry","primitive"],"author":{"name":"Tom MacWright"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/point-geometry/issues"},"homepage":"https://github.com/mapbox/point-geometry","devDependencies":{"documentation":"^14.0.3","eslint":"^9.6.0","eslint-config-mourner":"^4.0.2","typescript":"^5.5.3"},"_id":"@mapbox/point-geometry@1.1.0","gitHead":"88a80c38af4be41ee5ec5bdfb8b1e2bbf2304355","_nodeVersion":"20.12.1","_npmVersion":"10.5.1","dist":{"integrity":"sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==","shasum":"3328fb54b3a1273bc619bf0a6baad8de37181749","tarball":"https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz","fileCount":5,"unpackedSize":24180,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUIqawzFyGs2K7jlEIJ8fW+awTciJAR0bPXSNCdwz9QAiEAxoPzez/sAww5288kd4czepXaBILFGBY2b4pWCZ6Y6qQ="}]},"_npmUser":{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},"directories":{},"maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-geometry_1.1.0_1721122765104_0.06352219767229905"},"_hasShrinkwrap":false}},"time":{"created":"2017-04-21T17:07:39.943Z","modified":"2024-07-16T09:39:25.771Z","0.1.0":"2017-04-21T17:07:39.943Z","1.0.0":"2024-07-11T06:05:37.430Z","1.1.0":"2024-07-16T09:39:25.234Z"},"bugs":{"url":"https://github.com/mapbox/point-geometry/issues"},"author":{"name":"Tom MacWright"},"license":"ISC","homepage":"https://github.com/mapbox/point-geometry","keywords":["point","geometry","primitive"],"repository":{"type":"git","url":"git+ssh://git@github.com/mapbox/point-geometry.git"},"description":"a point geometry with transforms","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"readme":"# @mapbox/point-geometry\n\nA `Point` class for representing point geometry with useful utility methods.\n\n## Installation\n\n```sh\n$ npm install @mapbox/point-geometry\n```\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### Point\n\nA standalone point geometry with useful accessor, comparison, and\nmodification methods.\n\n#### Parameters\n\n*   `x` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.\n*   `y` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.\n\n#### Examples\n\n```javascript\nconst point = new Point(-77, 38);\n```\n\n#### clone\n\nClone this point, returning a new point that can be modified\nwithout affecting the old one.\n\nReturns **[Point](#point)** the clone\n\n#### add\n\nAdd this point's x & y coordinates to another point,\nyielding a new point.\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[Point](#point)** output point\n\n#### sub\n\nSubtract this point's x & y coordinates to from point,\nyielding a new point.\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[Point](#point)** output point\n\n#### multByPoint\n\nMultiply this point's x & y coordinates by point,\nyielding a new point.\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[Point](#point)** output point\n\n#### divByPoint\n\nDivide this point's x & y coordinates by point,\nyielding a new point.\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[Point](#point)** output point\n\n#### mult\n\nMultiply this point's x & y coordinates by a factor,\nyielding a new point.\n\n##### Parameters\n\n*   `k` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** factor\n\nReturns **[Point](#point)** output point\n\n#### div\n\nDivide this point's x & y coordinates by a factor,\nyielding a new point.\n\n##### Parameters\n\n*   `k` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** factor\n\nReturns **[Point](#point)** output point\n\n#### rotate\n\nRotate this point around the 0, 0 origin by an angle a,\ngiven in radians\n\n##### Parameters\n\n*   `a` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle to rotate around, in radians\n\nReturns **[Point](#point)** output point\n\n#### rotateAround\n\nRotate this point around p point by an angle a,\ngiven in radians\n\n##### Parameters\n\n*   `a` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle to rotate around, in radians\n*   `p` **[Point](#point)** Point to rotate around\n\nReturns **[Point](#point)** output point\n\n#### matMult\n\nMultiply this point by a 4x1 transformation matrix\n\n##### Parameters\n\n*   `m` **\\[[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)]** transformation matrix\n\nReturns **[Point](#point)** output point\n\n#### unit\n\nCalculate this point but as a unit vector from 0, 0, meaning\nthat the distance from the resulting point to the 0, 0\ncoordinate will be equal to 1 and the angle from the resulting\npoint to the 0, 0 coordinate will be the same as before.\n\nReturns **[Point](#point)** unit vector point\n\n#### perp\n\nCompute a perpendicular point, where the new y coordinate\nis the old x coordinate and the new x coordinate is the old y\ncoordinate multiplied by -1\n\nReturns **[Point](#point)** perpendicular point\n\n#### round\n\nReturn a version of this point with the x & y coordinates\nrounded to integers.\n\nReturns **[Point](#point)** rounded point\n\n#### mag\n\nReturn the magnitude of this point: this is the Euclidean\ndistance from the 0, 0 coordinate to this point's x and y\ncoordinates.\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** magnitude\n\n#### equals\n\nJudge whether this point is equal to another point, returning\ntrue or false.\n\n##### Parameters\n\n*   `other` **[Point](#point)** the other point\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether the points are equal\n\n#### dist\n\nCalculate the distance from this point to another point\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance\n\n#### distSqr\n\nCalculate the distance from this point to another point,\nwithout the square root step. Useful if you're comparing\nrelative distances.\n\n##### Parameters\n\n*   `p` **[Point](#point)** the other point\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance\n\n#### angle\n\nGet the angle from the 0, 0 coordinate to this point, in radians\ncoordinates.\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle\n\n#### angleTo\n\nGet the angle from this point to another point, in radians\n\n##### Parameters\n\n*   `b` **[Point](#point)** the other point\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle\n\n#### angleWith\n\nGet the angle between this point and another point, in radians\n\n##### Parameters\n\n*   `b` **[Point](#point)** the other point\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle\n\n#### angleWithSep\n\nFind the angle of the two vectors, solving the formula for\nthe cross product a x b = |a||b|sin(θ) for θ.\n\n##### Parameters\n\n*   `x` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the x-coordinate\n*   `y` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the y-coordinate\n\nReturns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the angle in radians\n\n#### convert\n\nConstruct a point from an array if necessary, otherwise if the input\nis already a Point, or an unknown type, return it unchanged\n\n##### Parameters\n\n*   `a` **(\\[[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)] | [Point](#point))** any kind of input value\n\n##### Examples\n\n```javascript\n// this\nvar point = Point.convert([0, 1]);\n// is equivalent to\nvar point = new Point(0, 1);\n```\n\nReturns **[Point](#point)** constructed point, or passed-through value.\n","readmeFilename":"README.md","users":{"petabytekr":true}}