ixfx
    Preparing search index...

    Function center

    • 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.

      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

      Parameters

      Returns Geometry.Point