We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcd1a0e commit 24a48fdCopy full SHA for 24a48fd
modules/ILL/ILL/Ass/Shape/Point.moon
@@ -50,9 +50,10 @@ class Point
50
51
-- Rotate the object according the given params.
52
rotate: (angle, c = Point!) =>
53
- {:x, :y} = @
54
- @x = x * math.cos(angle) - y * math.sin(angle)
55
- @y = x * math.sin(angle) + y * math.cos(angle)
+ x_rel = @x - c.x
+ y_rel = @y - c.y
+ @x = x_rel * math.cos(angle) - y_rel * math.sin(angle) + c.x
56
+ @y = x_rel * math.sin(angle) + y_rel * math.cos(angle) + c.y
57
return @
58
59
@@ -204,4 +205,4 @@ class Point
204
205
py = a.y + u * (b.y - a.y) + v * (d.y - a.y) + u * v * (a.y - b.y + c.y - d.y)
206
return Point px, py
207
-{:Point}
208
+{:Point}
0 commit comments