import java.lang.Math;
public void rotate(double angle, double x = -1, double y = -1) {
if (x == -1) {
x = this.x;
}
if (y == -1) {
y = this.y;
}
if (this.angle != 0) {
this._out("Q");
}
this.angle = angle;
if (angle != 0) {
angle *= Math.PI / 180;
double c = Math.cos(angle);
double s = Math.sin(angle);
double cx = x * this.k;
double cy = (this.h - y) * this.k;
this._out(String.format("q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm", c, s, -s, c, cx, cy, -cx, -cy));
}
}