({{, (RefLink[Rotate, paclet:ref/Rotate])[g,θ]
represents 2D graphics primitives or any other objects g rotated counterclockwise by θ radians about the center of their bounding box. }, {, (RefLink[Rotate, paclet:ref/Rotate])[g,θ,{x,y}]
rotates about the point {x,y}. }, {, (RefLink[Rotate, paclet:ref/Rotate])[g,{u,v}]
rotates around the origin, transforming the 2D or 3D vector u to v.}, {, (RefLink[Rotate, paclet:ref/Rotate])[g,θ,w]
rotates 3D graphics primitives by θ radians around the 3D vector w anchored at the origin.}, {, (RefLink[Rotate, paclet:ref/Rotate])[g,θ,w,p]
rotates around the 3D vector w anchored at p.}, {, (RefLink[Rotate, paclet:ref/Rotate])[g,θ,{u,v}]
rotates by angle θ in the plane spanned by 3D vectors u and v.}})

OpenersNotesSection(Spacer1)Details and Options

θ (RefLink[Degree, paclet:ref/Degree]) or θ° specifies an angle in degrees.

If (RefLink[Rotate, paclet:ref/Rotate]) appears outside a graphic, the object g in (RefLink[Rotate, paclet:ref/Rotate])[g,θ] etc. can be any expression.

You can specify special points such as {(RefLink[Left, paclet:ref/Left]),(RefLink[Bottom, paclet:ref/Bottom])} within the bounding box for g.

The x position can be specified as (RefLink[Left, paclet:ref/Left]), (RefLink[Center, paclet:ref/Center]), or (RefLink[Right, paclet:ref/Right]); the y position as (RefLink[Bottom, paclet:ref/Bottom]), (RefLink[Center, paclet:ref/Center]), or (RefLink[Top, paclet:ref/Top]).

If (RefLink[Rotate, paclet:ref/Rotate]) appears within a graphic, the coordinates {x,y} are taken to be in the coordinate system of the graphic.

If (RefLink[Rotate, paclet:ref/Rotate]) appears outside a graphic, the coordinates {x,y} are taken to run from -1 to +1 across the bounding box of the object being rotated.

(RefLink[Rotate, paclet:ref/Rotate])[g,θ] is equivalent to (RefLink[Rotate, paclet:ref/Rotate])[g,θ,{(RefLink[Center, paclet:ref/Center]),(RefLink[Center, paclet:ref/Center])}].

For objects specified with scaled coordinates (RefLink[Scaled, paclet:ref/Scaled])[{x,y}], (RefLink[Rotate, paclet:ref/Rotate]) effectively applies its transformation to the corresponding ordinary coordinates.

If (RefLink[Rotate, paclet:ref/Rotate]) appears inside a graphic, (RefLink[Normal, paclet:ref/Normal])[expr] if possible replaces all (RefLink[Rotate, paclet:ref/Rotate])[(Subscript[g, i]),…] constructs by versions of the (Subscript[g, i]) in which the coordinates have explicitly been transformed.

OpenersPrimaryExamplesSection(Spacer1)Examples  (20)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Rotate a square by 30°:

Graphics[Rotate[Rectangle[],30Degree]]

Rotate a cuboid by 30° around the z axis:

Graphics3D[Rotate[Cuboid[],30Degree,{0,0,1}]]

Rotate text by 45°:

Rotate[(Sqrt[(b^2)-4 a c]), 45 Degree]

OpenersExampleSection1(Spacer1)Scope  (8)

Transformation applied to a 2D shape:

gr={Rectangle[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0}]},{Green,Point[{1,1}]}};

Graphics[{{Opacity[.35],Blue,gr},Rotate[{Opacity[.85],Red,gr},Pi/6]}]

Transformation applied to a 3D shape:

gr={Cuboid[],AbsolutePointSize[10],Opacity[1],{Magenta,Point[{0,0,0}]},{Green,Point[{1,1,1}]}};

Graphics3D[{{Opacity[.35],Blue,gr},Rotate[{Opacity[.85],Red,gr},Pi/6,{0,0,1},{.5,.5,.5}]},Boxed->False]

Rotation around the z axis, keeping the point (1,1,1) fixed:

Graphics3D[Rotate[Cuboid[],Pi,{0,0,1},{1,1,1}],Axes->True,PlotRange->{{0,2},{0,2},{0,2}}]

Rotation mapping vector (1,1,1) to vector (0,0,1):

Graphics3D[Rotate[Cuboid[],{{1,1,1},{0,0,1}}]]

Rotation in the plane spanned by vectors (1,1,0) and (0,0,1):

Graphics3D[Rotate[Cylinder[],Pi/2,{{1,1,0},{0,0,1}}]]

Rotate text:

Graphics[Rotate[Style[Text["Mathematica"],24],-Pi/4]]

Rotate objects with scaled coordinates:

Graphics[Rotate[Circle[Scaled[{1,0}]],Pi,{0,0}],Axes->True]

Keep the lower-right corner of the rectangle fixed:

Graphics[{Circle[],Rotate[Rectangle[],Pi/4,{Right,Bottom}]},Axes->True]

OpenersExampleSection2(Spacer1)Applications  (2)

Grid with vertical text:

Grid[{
{Rotate["Primary",90°,{1,1}],"Red"},{,"Blue"},{,"Yellow"},
{Rotate["Secondary",90°,{1,1}],"Purple"},{,"Green"},{,"Orange"}
},Frame->All,Alignment->Left]

Diamond grid:

Rotate[Grid[Table[Rotate[{i,j},45°],{i,0,2},{j,0,2}],Frame->All],-45°]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

When possible, (RefLink[Normal, paclet:ref/Normal]) will transform the coordinates explicitly:

Normal@Rotate[Cylinder[],Pi/4,{1,0,0}]

OpenersExampleSection4(Spacer1)Possible Issues  (4)

By default, (RefLink[Rotate, paclet:ref/Rotate]) uses the center of the bounding box as the center of rotation:

Graphics[{Opacity[0.5],Rotate[Rectangle[],Pi/3]},Axes->True]

Explicitly specify a center of rotation:

Graphics[{Opacity[0.5],Rotate[Rectangle[],Pi/3,{0,0}]},Axes->True]

Transforming an object may move it out of view:

Graphics[Rotate[Circle[],Pi/2,Right],Axes->True]

Adjust the (RefLink[PlotRange, paclet:ref/PlotRange]) to display the transformed object:

Graphics[Rotate[Circle[],Pi/2,Right],Axes->True,PlotRange->2]

The center of the baseline of rotated text aligns with the baseline of the surrounding text:

Row[{"abc",Rotate["ghi",90°], "xyz"}," "]

For a different alignment, specify an explicit center of rotation:

Row[{"abc",Rotate["ghi",90°,{Left,Baseline}], "xyz"}," "]

Since text bounding boxes are always rectilinear, successive rotations can introduce extra space:

NestList[Style[Rotate[#,30 Degree],Background->RGBColor[1,0,0,0.2]]&,"R",8]

OpenersExampleSection5(Spacer1)Neat Examples  (2)

Rotations of a regular polygon:

Graphics[Outer[Rotate[Rotate[Line[{{1,0},{Sqrt[3],1}/2}],#,{0,0}],#2,{1,0}]&,Pi/6Range[12],Pi/6Range[12]]]

Nested, rotated square roots:

Nest[Rotate[Sqrt[#], 90°]&, 2, 8]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[RotationMatrix, paclet:ref/RotationMatrix])  ▪  (RefLink[RotationTransform, paclet:ref/RotationTransform])  ▪  (RefLink[EulerMatrix, paclet:ref/EulerMatrix])  ▪  (RefLink[RollPitchYawMatrix, paclet:ref/RollPitchYawMatrix])  ▪  (RefLink[Translate, paclet:ref/Translate])  ▪  (RefLink[Scale, paclet:ref/Scale])  ▪  (RefLink[GeometricTransformation, paclet:ref/GeometricTransformation])  ▪  (RefLink[ImageRotate, paclet:ref/ImageRotate])  ▪  (RefLink[AnglePath, paclet:ref/AnglePath])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graphics Transformations, paclet:guide/GraphicsTransformations])}, {▪(RefLinkPlain[Polygons, paclet:guide/Polygons])}, {▪(RefLinkPlain[Geometric Transforms, paclet:guide/GeometricTransforms])}, {▪(RefLinkPlain[Polyhedra, paclet:guide/Polyhedra])}, {▪(RefLinkPlain[Symbolic Graphics Language, paclet:guide/SymbolicGraphicsLanguage])}, {▪(RefLinkPlain[Angles and Polar Coordinates, paclet:guide/AnglesAndPolarCoordinates])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/14-coordinates-and-graphics.html])(WebLink[: Coordinates and Graphics, https://www.wolfram.com/language/elementary-introduction/14-coordinates-and-graphics.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/17-units.html])(WebLink[: Units, https://www.wolfram.com/language/elementary-introduction/17-units.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/26-pure-anonymous-functions.html])(WebLink[: Pure Anonymous Functions, https://www.wolfram.com/language/elementary-introduction/26-pure-anonymous-functions.html])}})}})