Function corners

Returns the four corners of a rectangle as an array of Points.

import { Rects } from "https://unpkg.com/ixfx/dist/geometry.js";
const rect = { width: 100, height: 100, x: 0, y: 0};
const pts = Rects.corners(rect);

If the rectangle is not positioned, is origin can be provided. Order of corners: ne, nw, sw, se