{"versions":{"0.1.0":{"name":"@mapbox/point-geometry","version":"0.1.0","description":"a point geometry with transforms","main":"index.js","scripts":{"test":"tape test.js","doc":"dox -r < index.js | doxme --readme > README.md","cov":"istanbul cover test.js && coveralls < ./coverage/lcov.info"},"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":{"coveralls":"~2.10.1","dox":"^0.6.1","doxme":"^1.8.2","istanbul":"~0.2.11","tape":"~2.13.3"},"gitHead":"168c4666af9167f11d40c4718b05729d98046834","_id":"@mapbox/point-geometry@0.1.0","_shasum":"8a83f9335c7860effa2eeeca254332aa0aeed8f2","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.2","_npmUser":{"name":"anonymous","email":"flippmoke@gmail.com"},"dist":{"shasum":"8a83f9335c7860effa2eeeca254332aa0aeed8f2","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz"},"maintainers":[{"name":"anonymous","email":"flippmoke@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/point-geometry-0.1.0.tgz_1492794459278_0.23473566002212465"},"directories":{},"contributors":[]},"1.0.0":{"name":"@mapbox/point-geometry","version":"1.0.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.0.0","gitHead":"ebc356d59effba58e79c1a0c5539658ab1110d15","_nodeVersion":"20.12.1","_npmVersion":"10.5.1","dist":{"integrity":"sha512-1EPbCrZvs+eBayaMcPeDmwsbgG/b7vQxtYlzLI/5dA2SHctbUxFr13OE4+AdozoF8EtvbaFcfQIzWetOfooz/w==","shasum":"5e597e37f57951999f64f9f512afead9ad4b1c16","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@mapbox/point-geometry/-/point-geometry-1.0.0.tgz","fileCount":5,"unpackedSize":23542,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/bZfqgQGl23+hIelqxAMPcDp0vq6EMeRPAw+IXcOp+AiEA5SY85DILzU9E2tS1x+V33L4LFKGTny4aOdBsvqmrJMU="}]},"_npmUser":{"name":"anonymous","email":"accounts+npmjs-06@mapbox.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"anonymous","email":"yannick.meeus@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-01@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-02@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-07@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-03@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-04@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-09@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-05@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-06@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-08@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs@mapbox.com"},{"name":"anonymous","email":"accounts@mapbox.com"},{"name":"anonymous","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-geometry_1.0.0_1720677937293_0.43414735907075586"},"_hasShrinkwrap":false,"contributors":[]},"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":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz","fileCount":5,"unpackedSize":24180,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUIqawzFyGs2K7jlEIJ8fW+awTciJAR0bPXSNCdwz9QAiEAxoPzez/sAww5288kd4czepXaBILFGBY2b4pWCZ6Y6qQ="}]},"_npmUser":{"name":"anonymous","email":"accounts+npmjs-05@mapbox.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"anonymous","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"anonymous","email":"yannick.meeus@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-01@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-02@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-07@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-03@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-04@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-09@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-05@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-06@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-08@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"anonymous","email":"accounts+npmjs@mapbox.com"},{"name":"anonymous","email":"accounts@mapbox.com"},{"name":"anonymous","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,"contributors":[]}},"dist-tags":{"latest":"1.1.0"},"name":"@mapbox/point-geometry","time":{"modified":"2024-07-16T12:02:53.064Z","created":"2022-01-26T19:14:13.627Z","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"},"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.","users":{}}