Skip to main content

Rotate

WLJS
Execution environment
Supports dynamics
Rotate[g_, angle_Real]

rotates graphics primitive or list of primitives g by angle

Rotate[g_, angle_Real, origin_List]

rotates around origin

Graphics[Rotate[Rectangle[{-1,-1}, {1,1}], 30 Degree]]

Dynamics

It support dynamic updates for angle variable. Graphics primitives g can be updated separately. Rotate only applies transformation on g.

EventHandler[InputRange[0, 2.0 Pi, 0.1], Function[a,
angle = a
]]
% // EventFire;

Graphics[Rotate[Rectangle[{-1,-1}, {1,1}], angle // Offload]]