rotate method
This point turned by degrees about center.
Implementation
ExpressivePoint rotate(
double degrees, {
ExpressivePoint center = ExpressivePoint.zero,
}) {
final radians = degrees * math.pi / 180;
final off = this - center;
final cos = math.cos(radians);
final sin = math.sin(radians);
return ExpressivePoint(
off.x * cos - off.y * sin,
off.x * sin + off.y * cos,
) +
center;
}