Pixel-Composer/scripts/point_rotate/point_rotate.gml
2022-01-13 11:24:03 +07:00

8 lines
186 B
Plaintext

function point_rotate(px, py, ox, oy, a) {
var cx = px - ox;
var cy = py - oy;
var d = -degtorad(a);
return [ox + cx * cos(d) - cy * sin(d),
oy + cx * sin(d) + cy * cos(d)];
}