UNPKG

@thi.ng/geom

Version:

Functional, polymorphic API for 2D geometry types & SVG generation

10 lines (9 loc) 224 B
import { bounds } from "./bounds.js"; import { centroid } from "./centroid.js"; const centroidOfBounds = (shape, out) => { const b = bounds(shape); return b ? centroid(b, out) : void 0; }; export { centroidOfBounds };