Return the distance of pt to the center of rect.
pt
rect
const rect = { width: 100, height: 100, x: 0, y: 0 };Rects.distanceFromCenter(rect, { x: 20, y: 20 }); Copy
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
.