expressiveRotated function
polygon through Compose's Matrix().apply { rotateZ(degrees) }.
Implementation
ExpressiveRoundedPolygon expressiveRotated(
ExpressiveRoundedPolygon polygon,
double degrees,
) {
final r = degrees * math.pi / 180;
final s = math.sin(r);
final c = math.cos(r);
return polygon.transformed((x, y) => (c * x - s * y, s * x + c * y));
}