Returns the center of a rectangle as a Geometry.Point. If the rectangle lacks a position and origin parameter is not provided, 0,0 is used instead.
origin
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const p = Rects.center({x:10, y:20, width:100, height:50});const p2 = Rects.center({width: 100, height: 50}); // Assumes 0,0 for rect x,y Copy
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const p = Rects.center({x:10, y:20, width:100, height:50});const p2 = Rects.center({width: 100, height: 50}); // Assumes 0,0 for rect x,y
Rectangle
Optional
Optional origin. Overrides rect position if available. If no position is available 0,0 is used by default.
rect
Returns the center of a rectangle as a Geometry.Point. If the rectangle lacks a position and
origin
parameter is not provided, 0,0 is used instead.