@mapbox/point-geometry
Advanced tools
Comparing version 0.1.0 to 1.0.0
222
index.js
@@ -1,5 +0,1 @@ | ||
'use strict'; | ||
module.exports = Point; | ||
/** | ||
@@ -9,17 +5,15 @@ * A standalone point geometry with useful accessor, comparison, and | ||
* | ||
* @class Point | ||
* @param {Number} x the x-coordinate. this could be longitude or screen | ||
* pixels, or any other sort of unit. | ||
* @param {Number} y the y-coordinate. this could be latitude or screen | ||
* pixels, or any other sort of unit. | ||
* @example | ||
* var point = new Point(-77, 38); | ||
* const point = new Point(-77, 38); | ||
*/ | ||
function Point(x, y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
export default class Point { | ||
/** | ||
* @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit. | ||
* @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit. | ||
*/ | ||
constructor(x, y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
Point.prototype = { | ||
/** | ||
@@ -30,3 +24,3 @@ * Clone this point, returning a new point that can be modified | ||
*/ | ||
clone: function() { return new Point(this.x, this.y); }, | ||
clone() { return new Point(this.x, this.y); } | ||
@@ -39,3 +33,3 @@ /** | ||
*/ | ||
add: function(p) { return this.clone()._add(p); }, | ||
add(p) { return this.clone()._add(p); } | ||
@@ -48,3 +42,3 @@ /** | ||
*/ | ||
sub: function(p) { return this.clone()._sub(p); }, | ||
sub(p) { return this.clone()._sub(p); } | ||
@@ -57,3 +51,3 @@ /** | ||
*/ | ||
multByPoint: function(p) { return this.clone()._multByPoint(p); }, | ||
multByPoint(p) { return this.clone()._multByPoint(p); } | ||
@@ -66,3 +60,3 @@ /** | ||
*/ | ||
divByPoint: function(p) { return this.clone()._divByPoint(p); }, | ||
divByPoint(p) { return this.clone()._divByPoint(p); } | ||
@@ -72,6 +66,6 @@ /** | ||
* yielding a new point. | ||
* @param {Point} k factor | ||
* @param {number} k factor | ||
* @return {Point} output point | ||
*/ | ||
mult: function(k) { return this.clone()._mult(k); }, | ||
mult(k) { return this.clone()._mult(k); } | ||
@@ -81,6 +75,6 @@ /** | ||
* yielding a new point. | ||
* @param {Point} k factor | ||
* @param {number} k factor | ||
* @return {Point} output point | ||
*/ | ||
div: function(k) { return this.clone()._div(k); }, | ||
div(k) { return this.clone()._div(k); } | ||
@@ -90,6 +84,6 @@ /** | ||
* given in radians | ||
* @param {Number} a angle to rotate around, in radians | ||
* @param {number} a angle to rotate around, in radians | ||
* @return {Point} output point | ||
*/ | ||
rotate: function(a) { return this.clone()._rotate(a); }, | ||
rotate(a) { return this.clone()._rotate(a); } | ||
@@ -99,14 +93,14 @@ /** | ||
* given in radians | ||
* @param {Number} a angle to rotate around, in radians | ||
* @param {number} a angle to rotate around, in radians | ||
* @param {Point} p Point to rotate around | ||
* @return {Point} output point | ||
*/ | ||
rotateAround: function(a,p) { return this.clone()._rotateAround(a,p); }, | ||
rotateAround(a, p) { return this.clone()._rotateAround(a, p); } | ||
/** | ||
* Multiply this point by a 4x1 transformation matrix | ||
* @param {Array<Number>} m transformation matrix | ||
* @param {[number, number, number, number]} m transformation matrix | ||
* @return {Point} output point | ||
*/ | ||
matMult: function(m) { return this.clone()._matMult(m); }, | ||
matMult(m) { return this.clone()._matMult(m); } | ||
@@ -120,3 +114,3 @@ /** | ||
*/ | ||
unit: function() { return this.clone()._unit(); }, | ||
unit() { return this.clone()._unit(); } | ||
@@ -129,3 +123,3 @@ /** | ||
*/ | ||
perp: function() { return this.clone()._perp(); }, | ||
perp() { return this.clone()._perp(); } | ||
@@ -137,13 +131,13 @@ /** | ||
*/ | ||
round: function() { return this.clone()._round(); }, | ||
round() { return this.clone()._round(); } | ||
/** | ||
* Return the magitude of this point: this is the Euclidean | ||
* Return the magnitude of this point: this is the Euclidean | ||
* distance from the 0, 0 coordinate to this point's x and y | ||
* coordinates. | ||
* @return {Number} magnitude | ||
* @return {number} magnitude | ||
*/ | ||
mag: function() { | ||
mag() { | ||
return Math.sqrt(this.x * this.x + this.y * this.y); | ||
}, | ||
} | ||
@@ -156,6 +150,6 @@ /** | ||
*/ | ||
equals: function(other) { | ||
equals(other) { | ||
return this.x === other.x && | ||
this.y === other.y; | ||
}, | ||
} | ||
@@ -165,7 +159,7 @@ /** | ||
* @param {Point} p the other point | ||
* @return {Number} distance | ||
* @return {number} distance | ||
*/ | ||
dist: function(p) { | ||
dist(p) { | ||
return Math.sqrt(this.distSqr(p)); | ||
}, | ||
} | ||
@@ -177,9 +171,9 @@ /** | ||
* @param {Point} p the other point | ||
* @return {Number} distance | ||
* @return {number} distance | ||
*/ | ||
distSqr: function(p) { | ||
var dx = p.x - this.x, | ||
distSqr(p) { | ||
const dx = p.x - this.x, | ||
dy = p.y - this.y; | ||
return dx * dx + dy * dy; | ||
}, | ||
} | ||
@@ -189,7 +183,7 @@ /** | ||
* coordinates. | ||
* @return {Number} angle | ||
* @return {number} angle | ||
*/ | ||
angle: function() { | ||
angle() { | ||
return Math.atan2(this.y, this.x); | ||
}, | ||
} | ||
@@ -199,7 +193,7 @@ /** | ||
* @param {Point} b the other point | ||
* @return {Number} angle | ||
* @return {number} angle | ||
*/ | ||
angleTo: function(b) { | ||
angleTo(b) { | ||
return Math.atan2(this.y - b.y, this.x - b.x); | ||
}, | ||
} | ||
@@ -209,23 +203,24 @@ /** | ||
* @param {Point} b the other point | ||
* @return {Number} angle | ||
* @return {number} angle | ||
*/ | ||
angleWith: function(b) { | ||
angleWith(b) { | ||
return this.angleWithSep(b.x, b.y); | ||
}, | ||
} | ||
/* | ||
/** | ||
* Find the angle of the two vectors, solving the formula for | ||
* the cross product a x b = |a||b|sin(θ) for θ. | ||
* @param {Number} x the x-coordinate | ||
* @param {Number} y the y-coordinate | ||
* @return {Number} the angle in radians | ||
* @param {number} x the x-coordinate | ||
* @param {number} y the y-coordinate | ||
* @return {number} the angle in radians | ||
*/ | ||
angleWithSep: function(x, y) { | ||
angleWithSep(x, y) { | ||
return Math.atan2( | ||
this.x * y - this.y * x, | ||
this.x * x + this.y * y); | ||
}, | ||
} | ||
_matMult: function(m) { | ||
var x = m[0] * this.x + m[1] * this.y, | ||
/** @param {[number, number, number, number]} m */ | ||
_matMult(m) { | ||
const x = m[0] * this.x + m[1] * this.y, | ||
y = m[2] * this.x + m[3] * this.y; | ||
@@ -235,54 +230,61 @@ this.x = x; | ||
return this; | ||
}, | ||
} | ||
_add: function(p) { | ||
/** @param {Point} p */ | ||
_add(p) { | ||
this.x += p.x; | ||
this.y += p.y; | ||
return this; | ||
}, | ||
} | ||
_sub: function(p) { | ||
/** @param {Point} p */ | ||
_sub(p) { | ||
this.x -= p.x; | ||
this.y -= p.y; | ||
return this; | ||
}, | ||
} | ||
_mult: function(k) { | ||
/** @param {number} k */ | ||
_mult(k) { | ||
this.x *= k; | ||
this.y *= k; | ||
return this; | ||
}, | ||
} | ||
_div: function(k) { | ||
/** @param {number} k */ | ||
_div(k) { | ||
this.x /= k; | ||
this.y /= k; | ||
return this; | ||
}, | ||
} | ||
_multByPoint: function(p) { | ||
/** @param {Point} p */ | ||
_multByPoint(p) { | ||
this.x *= p.x; | ||
this.y *= p.y; | ||
return this; | ||
}, | ||
} | ||
_divByPoint: function(p) { | ||
/** @param {Point} p */ | ||
_divByPoint(p) { | ||
this.x /= p.x; | ||
this.y /= p.y; | ||
return this; | ||
}, | ||
} | ||
_unit: function() { | ||
_unit() { | ||
this._div(this.mag()); | ||
return this; | ||
}, | ||
} | ||
_perp: function() { | ||
var y = this.y; | ||
_perp() { | ||
const y = this.y; | ||
this.y = this.x; | ||
this.x = -y; | ||
return this; | ||
}, | ||
} | ||
_rotate: function(angle) { | ||
var cos = Math.cos(angle), | ||
/** @param {number} angle */ | ||
_rotate(angle) { | ||
const cos = Math.cos(angle), | ||
sin = Math.sin(angle), | ||
@@ -294,6 +296,10 @@ x = cos * this.x - sin * this.y, | ||
return this; | ||
}, | ||
} | ||
_rotateAround: function(angle, p) { | ||
var cos = Math.cos(angle), | ||
/** | ||
* @param {number} angle | ||
* @param {Point} p | ||
*/ | ||
_rotateAround(angle, p) { | ||
const cos = Math.cos(angle), | ||
sin = Math.sin(angle), | ||
@@ -305,5 +311,5 @@ x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y), | ||
return this; | ||
}, | ||
} | ||
_round: function() { | ||
_round() { | ||
this.x = Math.round(this.x); | ||
@@ -313,23 +319,23 @@ this.y = Math.round(this.y); | ||
} | ||
}; | ||
/** | ||
* Construct a point from an array if necessary, otherwise if the input | ||
* is already a Point, or an unknown type, return it unchanged | ||
* @param {Array<Number>|Point|*} a any kind of input value | ||
* @return {Point} constructed point, or passed-through value. | ||
* @example | ||
* // this | ||
* var point = Point.convert([0, 1]); | ||
* // is equivalent to | ||
* var point = new Point(0, 1); | ||
*/ | ||
Point.convert = function (a) { | ||
if (a instanceof Point) { | ||
/** | ||
* Construct a point from an array if necessary, otherwise if the input | ||
* is already a Point, or an unknown type, return it unchanged | ||
* @param {[number, number] | Point} a any kind of input value | ||
* @return {Point} constructed point, or passed-through value. | ||
* @example | ||
* // this | ||
* var point = Point.convert([0, 1]); | ||
* // is equivalent to | ||
* var point = new Point(0, 1); | ||
*/ | ||
static convert(a) { | ||
if (a instanceof Point) { | ||
return a; | ||
} | ||
if (Array.isArray(a)) { | ||
return new Point(a[0], a[1]); | ||
} | ||
return a; | ||
} | ||
if (Array.isArray(a)) { | ||
return new Point(a[0], a[1]); | ||
} | ||
return a; | ||
}; | ||
} |
{ | ||
"name": "@mapbox/point-geometry", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "a point geometry with transforms", | ||
"main": "index.js", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"test": "tape test.js", | ||
"doc": "dox -r < index.js | doxme --readme > README.md", | ||
"cov": "istanbul cover test.js && coveralls < ./coverage/lcov.info" | ||
"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" | ||
}, | ||
@@ -27,8 +32,10 @@ "repository": { | ||
"devDependencies": { | ||
"coveralls": "~2.10.1", | ||
"dox": "^0.6.1", | ||
"doxme": "^1.8.2", | ||
"istanbul": "~0.2.11", | ||
"tape": "~2.13.3" | ||
} | ||
"documentation": "^14.0.3", | ||
"eslint": "^9.6.0", | ||
"eslint-config-mourner": "^4.0.2", | ||
"typescript": "^5.5.3" | ||
}, | ||
"files": [ | ||
"index.d.ts" | ||
] | ||
} |
301
README.md
@@ -1,184 +0,139 @@ | ||
# point-geometry | ||
# @mapbox/point-geometry | ||
[![build status](https://secure.travis-ci.org/mapbox/point-geometry.png)](http://travis-ci.org/mapbox/point-geometry) [![Coverage Status](https://coveralls.io/repos/mapbox/point-geometry/badge.svg?branch=master)](https://coveralls.io/r/mapbox/point-geometry?branch=master) | ||
A `Point` class for representing point geometry with useful utility methods. | ||
a point geometry with transforms | ||
## Installation | ||
```sh | ||
$ npm install @mapbox/point-geometry | ||
``` | ||
### `Point(x, y)` | ||
## API | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
### Point | ||
A standalone point geometry with useful accessor, comparison, and | ||
modification methods. | ||
#### Parameters | ||
### Parameters | ||
* `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. | ||
* `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. | ||
| parameter | type | description | | ||
| --------- | ------ | -------------------------------------------------------------------------------------- | | ||
| `x` | Number | the x-coordinate. this could be longitude or screen pixels, or any other sort of unit. | | ||
| `y` | Number | the y-coordinate. this could be latitude or screen pixels, or any other sort of unit. | | ||
#### Examples | ||
### Example | ||
```js | ||
var point = new Point(-77, 38); | ||
```javascript | ||
const point = new Point(-77, 38); | ||
``` | ||
#### clone | ||
### `clone` | ||
Clone this point, returning a new point that can be modified | ||
without affecting the old one. | ||
Returns **[Point](#point)** the clone | ||
**Returns** `Point`, the clone | ||
#### add | ||
### `add(p)` | ||
Add this point's x & y coordinates to another point, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[Point](#point)** output point | ||
#### sub | ||
**Returns** `Point`, output point | ||
### `sub(p)` | ||
Subtract this point's x & y coordinates to from point, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[Point](#point)** output point | ||
#### multByPoint | ||
**Returns** `Point`, output point | ||
### `multByPoint(p)` | ||
Multiply this point's x & y coordinates by point, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[Point](#point)** output point | ||
#### divByPoint | ||
**Returns** `Point`, output point | ||
### `divByPoint(p)` | ||
Divide this point's x & y coordinates by point, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[Point](#point)** output point | ||
#### mult | ||
**Returns** `Point`, output point | ||
### `mult(k)` | ||
Multiply this point's x & y coordinates by a factor, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | ----------- | | ||
| `k` | Point | factor | | ||
* `k` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** factor | ||
Returns **[Point](#point)** output point | ||
#### div | ||
**Returns** `Point`, output point | ||
### `div(k)` | ||
Divide this point's x & y coordinates by a factor, | ||
yielding a new point. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | ----------- | | ||
| `k` | Point | factor | | ||
* `k` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** factor | ||
Returns **[Point](#point)** output point | ||
#### rotate | ||
**Returns** `Point`, output point | ||
### `rotate(a)` | ||
Rotate this point around the 0, 0 origin by an angle a, | ||
given in radians | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ------ | ---------------------------------- | | ||
| `a` | Number | angle to rotate around, in radians | | ||
* `a` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle to rotate around, in radians | ||
Returns **[Point](#point)** output point | ||
#### rotateAround | ||
**Returns** `Point`, output point | ||
### `rotateAround(a, p)` | ||
Rotate this point around p point by an angle a, | ||
given in radians | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ------ | ---------------------------------- | | ||
| `a` | Number | angle to rotate around, in radians | | ||
| `p` | Point | Point to rotate around | | ||
* `a` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle to rotate around, in radians | ||
* `p` **[Point](#point)** Point to rotate around | ||
Returns **[Point](#point)** output point | ||
#### matMult | ||
**Returns** `Point`, output point | ||
### `matMult(m)` | ||
Multiply this point by a 4x1 transformation matrix | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----------------- | --------------------- | | ||
| `m` | Array\.\<Number\> | transformation matrix | | ||
* `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 | ||
Returns **[Point](#point)** output point | ||
#### unit | ||
**Returns** `Point`, output point | ||
### `unit` | ||
Calculate this point but as a unit vector from 0, 0, meaning | ||
@@ -189,8 +144,6 @@ that the distance from the resulting point to the 0, 0 | ||
Returns **[Point](#point)** unit vector point | ||
**Returns** `Point`, unit vector point | ||
#### perp | ||
### `perp` | ||
Compute a perpendicular point, where the new y coordinate | ||
@@ -200,58 +153,42 @@ is the old x coordinate and the new x coordinate is the old y | ||
Returns **[Point](#point)** perpendicular point | ||
**Returns** `Point`, perpendicular point | ||
#### round | ||
### `round` | ||
Return a version of this point with the x & y coordinates | ||
rounded to integers. | ||
Returns **[Point](#point)** rounded point | ||
**Returns** `Point`, rounded point | ||
#### mag | ||
### `mag` | ||
Return the magitude of this point: this is the Euclidean | ||
Return the magnitude of this point: this is the Euclidean | ||
distance from the 0, 0 coordinate to this point's x and y | ||
coordinates. | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** magnitude | ||
**Returns** `Number`, magnitude | ||
#### equals | ||
### `equals(other)` | ||
Judge whether this point is equal to another point, returning | ||
true or false. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `other` | Point | the other point | | ||
* `other` **[Point](#point)** the other point | ||
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether the points are equal | ||
#### dist | ||
**Returns** `boolean`, whether the points are equal | ||
### `dist(p)` | ||
Calculate the distance from this point to another point | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance | ||
#### distSqr | ||
**Returns** `Number`, distance | ||
### `distSqr(p)` | ||
Calculate the distance from this point to another point, | ||
@@ -261,84 +198,59 @@ without the square root step. Useful if you're comparing | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `p` | Point | the other point | | ||
* `p` **[Point](#point)** the other point | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** distance | ||
#### angle | ||
**Returns** `Number`, distance | ||
### `angle` | ||
Get the angle from the 0, 0 coordinate to this point, in radians | ||
coordinates. | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle | ||
**Returns** `Number`, angle | ||
#### angleTo | ||
### `angleTo(b)` | ||
Get the angle from this point to another point, in radians | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `b` | Point | the other point | | ||
* `b` **[Point](#point)** the other point | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle | ||
#### angleWith | ||
**Returns** `Number`, angle | ||
### `angleWith(b)` | ||
Get the angle between this point and another point, in radians | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ----- | --------------- | | ||
| `b` | Point | the other point | | ||
* `b` **[Point](#point)** the other point | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle | ||
#### angleWithSep | ||
**Returns** `Number`, angle | ||
### `angleWithSep(x, y)` | ||
Find the angle of the two vectors, solving the formula for | ||
the cross product a x b = |a||b|sin(θ) for θ. | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ------ | ---------------- | | ||
| `x` | Number | the x-coordinate | | ||
| `y` | Number | the y-coordinate | | ||
* `x` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the x-coordinate | ||
* `y` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the y-coordinate | ||
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the angle in radians | ||
#### convert | ||
**Returns** `Number`, the angle in radians | ||
### `convert(a)` | ||
Construct a point from an array if necessary, otherwise if the input | ||
is already a Point, or an unknown type, return it unchanged | ||
### Parameters | ||
##### Parameters | ||
| parameter | type | description | | ||
| --------- | ------------------------ | ----------------------- | | ||
| `a` | Array\.\<Number\>\,Point | any kind of input value | | ||
* `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 | ||
##### Examples | ||
### Example | ||
```js | ||
```javascript | ||
// this | ||
@@ -350,19 +262,2 @@ var point = Point.convert([0, 1]); | ||
**Returns** `Point`, constructed point, or passed-through value. | ||
## Installation | ||
Requires [nodejs](http://nodejs.org/). | ||
```sh | ||
$ npm install point-geometry | ||
``` | ||
## Tests | ||
```sh | ||
$ npm test | ||
``` | ||
Returns **[Point](#point)** constructed point, or passed-through value. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4
480
0
Yes
23542
5
260
2