Bounds refactor and duplication removal

This commit is contained in:
Mark Tolmacs 2024-09-27 15:58:18 +02:00
parent 7b4e989d65
commit 91b6057d9c
No known key found for this signature in database
28 changed files with 431 additions and 147 deletions

View file

@ -102,6 +102,22 @@ export function pointRotateRads<Point extends GenericPoint>(
);
}
/**
* Rotate multiple points around a common center via the same angle in radians
*
* @param p The point array to rotate
* @param c The common center point
* @param angle The common angle to rotate by
* @returns The array of rotated points
*/
function pointsRotateRads<Point extends GenericPoint>(
p: Point[],
c: Point,
angle: Radians,
): Point[] {
return p.map((x, idx) => pointRotateRads(x, c, angle));
}
/**
* Roate a point by [angle] degree.
*