Return the distance of pt to the center of rect.
pt
rect
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const rect = { width: 100, height: 100, x: 0, y: 0 };Rects.distanceFromCenter(rect, { x: 20, y: 20 }); Copy
import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";const rect = { width: 100, height: 100, x: 0, y: 0 };Rects.distanceFromCenter(rect, { x: 20, y: 20 });
Return the distance of
pt
to the center ofrect
.