polygonRotate
Rotates a polygon around a given origin.
Basic example
Section titled “Basic example”Rotates every point of a polygon by the same angle (radians) around an origin, which defaults to [0, 0]. Here the dashed shape turns 30° about its own center into the solid one. largestRect tries candidate rectangles at many angles this way.
import {polygonRotate} from "@d3plus/math";
const poly = [
[60, 70],
[200, 60],
[210, 130],
[90, 150],
];
polygonRotate(poly, Math.PI / 6, [140, 100]);
Parameters
import {polygonRotate} from "@d3plus/math";