@thi.ng/geom-poly-utils
Advanced tools
Comparing version 0.1.17 to 0.1.18
@@ -16,2 +16,2 @@ import { addW3, dot, magSq, setC3, sub } from "@thi.ng/vectors"; | ||
}; | ||
export const fromBarycentric = (a, b, c, p, out) => addW3(out, a, b, c, p[0], p[1], p[2]); | ||
export const fromBarycentric = (a, b, c, p, out = []) => addW3(out, a, b, c, p[0], p[1], p[2]); |
import { Vec } from "@thi.ng/vectors"; | ||
export declare const centroid: (pts: import("@thi.ng/api").ArrayLikeIterable<number>[], out?: Vec) => Vec; | ||
export declare const centroid: (pts: import("@thi.ng/api").ArrayLikeIterable<number>[], out?: Vec | undefined) => Vec; |
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.17...@thi.ng/geom-poly-utils@0.1.18) (2019-07-07) | ||
### Bug Fixes | ||
* **geom-poly-utils:** update madd call sites ([#95](https://github.com/thi-ng/umbrella/issues/95)) ([3250c82](https://github.com/thi-ng/umbrella/commit/3250c82)) | ||
## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.16...@thi.ng/geom-poly-utils@0.1.17) (2019-05-22) | ||
@@ -8,0 +19,0 @@ |
@@ -11,2 +11,2 @@ /** | ||
*/ | ||
export declare const circumCenter2: (a: import("@thi.ng/api").ArrayLikeIterable<number>, b: import("@thi.ng/api").ArrayLikeIterable<number>, c: import("@thi.ng/api").ArrayLikeIterable<number>, eps?: number) => any[]; | ||
export declare const circumCenter2: (a: import("@thi.ng/api").ArrayLikeIterable<number>, b: import("@thi.ng/api").ArrayLikeIterable<number>, c: import("@thi.ng/api").ArrayLikeIterable<number>, eps?: number) => number[] | undefined; |
import { THIRD_PI } from "@thi.ng/math"; | ||
import { maddN2, mag, normalize, perpendicularLeft2, sub2 } from "@thi.ng/vectors"; | ||
import { maddN2, mag, normalize, perpendicularCCW, sub2 } from "@thi.ng/vectors"; | ||
export const equilateralTriangle2 = (a, b) => { | ||
const dir = sub2([], b, a); | ||
const c = normalize(null, perpendicularLeft2([], dir), mag(dir) * Math.sin(THIRD_PI)); | ||
return [a, b, maddN2(null, c, dir, 0.5)]; | ||
const c = normalize(null, perpendicularCCW([], dir), mag(dir) * Math.sin(THIRD_PI)); | ||
return [a, b, maddN2(null, dir, 0.5, c)]; | ||
}; |
@@ -37,3 +37,3 @@ 'use strict'; | ||
}; | ||
const fromBarycentric = (a, b, c, p, out) => vectors.addW3(out, a, b, c, p[0], p[1], p[2]); | ||
const fromBarycentric = (a, b, c, p, out = []) => vectors.addW3(out, a, b, c, p[0], p[1], p[2]); | ||
@@ -150,4 +150,4 @@ const bounds = (pts, vmin, vmax) => { | ||
const dir = vectors.sub2([], b, a); | ||
const c = vectors.normalize(null, vectors.perpendicularLeft2([], dir), vectors.mag(dir) * Math.sin(math.THIRD_PI)); | ||
return [a, b, vectors.maddN2(null, c, dir, 0.5)]; | ||
const c = vectors.normalize(null, vectors.perpendicularCCW([], dir), vectors.mag(dir) * Math.sin(math.THIRD_PI)); | ||
return [a, b, vectors.maddN2(null, dir, 0.5, c)]; | ||
}; | ||
@@ -154,0 +154,0 @@ |
@@ -35,3 +35,3 @@ (function (global, factory) { | ||
}; | ||
const fromBarycentric = (a, b, c, p, out) => vectors.addW3(out, a, b, c, p[0], p[1], p[2]); | ||
const fromBarycentric = (a, b, c, p, out = []) => vectors.addW3(out, a, b, c, p[0], p[1], p[2]); | ||
@@ -148,4 +148,4 @@ const bounds = (pts, vmin, vmax) => { | ||
const dir = vectors.sub2([], b, a); | ||
const c = vectors.normalize(null, vectors.perpendicularLeft2([], dir), vectors.mag(dir) * Math.sin(math.THIRD_PI)); | ||
return [a, b, vectors.maddN2(null, c, dir, 0.5)]; | ||
const c = vectors.normalize(null, vectors.perpendicularCCW([], dir), vectors.mag(dir) * Math.sin(math.THIRD_PI)); | ||
return [a, b, vectors.maddN2(null, dir, 0.5, c)]; | ||
}; | ||
@@ -152,0 +152,0 @@ |
{ | ||
"name": "@thi.ng/geom-poly-utils", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "Polygon / triangle analysis & processing utilities", | ||
@@ -28,13 +28,13 @@ "module": "./index.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.7", | ||
"@types/node": "^12.0.8", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.0.0", | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.4.5" | ||
"typescript": "^3.5.2" | ||
}, | ||
"dependencies": { | ||
"@thi.ng/errors": "^1.0.6", | ||
"@thi.ng/geom-api": "^0.2.3", | ||
"@thi.ng/math": "^1.3.0", | ||
"@thi.ng/vectors": "^2.5.6" | ||
"@thi.ng/errors": "^1.1.0", | ||
"@thi.ng/geom-api": "^0.2.4", | ||
"@thi.ng/math": "^1.4.0", | ||
"@thi.ng/vectors": "^3.0.0" | ||
}, | ||
@@ -60,3 +60,3 @@ "keywords": [ | ||
"sideEffects": false, | ||
"gitHead": "5a4226d52724f320fb25656f08addb2825375fee" | ||
"gitHead": "efa9fdd61dd4ad2187cefe0a26df3bf2baade24b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51885
- Removed@thi.ng/vectors@2.5.6(transitive)
Updated@thi.ng/errors@^1.1.0
Updated@thi.ng/geom-api@^0.2.4
Updated@thi.ng/math@^1.4.0
Updated@thi.ng/vectors@^3.0.0