Pixel-Composer/scripts/point_rotate/point_rotate.gml

8 lines
186 B
Text
Raw Normal View History

2022-01-13 05:24:03 +01:00
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)];
}