gives a TransformationFunction that represents a rotation in 2D by θ radians about the origin.
RotationTransform[θ,p]
gives a 2D rotation about the 2D point p.
RotationTransform[θ,w]
gives a 3D rotation around the direction of the 3D vector w.
RotationTransform[θ,w,p]
gives a 3D rotation around the axis w anchored at the point p.
RotationTransform[{u,v}]
gives a rotation about the origin that transforms the vector u to the direction of the vector v.
RotationTransform[{u,v},p]
gives a rotation about the point p that transforms u to the direction of v.
RotationTransform[θ,{u,v},…]
gives a rotation by θ radians in the plane spanned by u and v.
RotationTransform
gives a TransformationFunction that represents a rotation in 2D by θ radians about the origin.
RotationTransform[θ,p]
gives a 2D rotation about the 2D point p.
RotationTransform[θ,w]
gives a 3D rotation around the direction of the 3D vector w.
RotationTransform[θ,w,p]
gives a 3D rotation around the axis w anchored at the point p.
RotationTransform[{u,v}]
gives a rotation about the origin that transforms the vector u to the direction of the vector v.
RotationTransform[{u,v},p]
gives a rotation about the point p that transforms u to the direction of v.
RotationTransform[θ,{u,v},…]
gives a rotation by θ radians in the plane spanned by u and v.
Details
- RotationTransform gives a TransformationFunction that can be applied to vectors.
- θ Degree or θ° specifies an angle in degrees.
- RotationTransform[θ,{u,v},p] can be used to specify any rotation about any point p, in any number of dimensions.
- Positive θ in RotationTransform[θ,{u,v},p] corresponds to going from the direction of u toward the direction of v.
- RotationTransform[θ] is equivalent to RotationTransform[θ,{{1,0},{0,1}}].
- RotationTransform[θ,w] is equivalent to RotationTransform[θ,{u,v}], where u⊥w, v⊥w, and u,v,w form a right-handed coordinate system.
- RotationTransform[θ,{u,v}] can effectively specify any element of the
-dimensional rotation group
. RotationTransform[θ,{u,v},p] can effectively specify any element of the
-dimensional special Euclidean group.
Examples
open all close allBasic Examples (4)
A 2D rotation transform by θ radians:
r = RotationTransform[θ]r[{x, y}]r = RotationTransform[θ, {0, 0, 1}]r[{x, y, z}]Rotate a 2D graphic by 30° about the origin:
Graphics[GeometricTransformation[Rectangle[], RotationTransform[30Degree]], Frame -> True]cow = ExampleData[{"Geometry3D", "Cow"}, "GraphicsComplex"];Manipulate[Graphics3D[{EdgeForm[None], GeometricTransformation[cow, RotationTransform[k Pi / 8, {1, 0, 0}]]}], {k, -1, 1}, SaveDefinitions -> True]Scope (9)
Rotation by θ radians about the point {px,py}:
RotationTransform[θ, {px, py}]Rotation by θ radians around the
axis about the point {px,py,pz}:
RotationTransform[θ, {1, 0, 0}, {px, py, pz}]A 2D rotation by θ in the
plane:
RotationTransform[θ, {{1, 0}, {0, 1}}]A 3D rotation by θ in the
plane:
RotationTransform[θ, {{1, 0, 0}, {0, 1, 0}}]A 4D rotation by θ in the
plane:
RotationTransform[θ, {{1, 0, 0, 0}, {0, 1, 0, 0}}]A 3D rotation by θ in the plane parametrized by s{1,-1,1}+t{1,1,1}:
r = RotationTransform[θ, {{1, -1, 1}, {1, 1, 1}}]This rotates the vector {1,1,1}:
r[{1, -1, 1}]//TogetherGenerate the transform for a symbolic vector, assuming that all quantities are real:
ComplexExpand[RotationTransform[Pi, {x, y, z}], TargetFunctions -> {Re, Im}]//SimplifySimplify the result further by assuming that {x,y,z} is a unit vector:
Simplify[%, x ^ 2 + y ^ 2 + z ^ 2 == 1]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}, GeometricTransformation[{Opacity[.85], Red, gr}, RotationTransform[Pi / 6, {1, 1}]]}]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}, GeometricTransformation[{Opacity[.85], Red, gr}, RotationTransform[Pi / 6, {0, 0, 1}, {1, 1, 1}]]}, Boxed -> False]Applications (5)
Basic (2)
Parametrize a great circle passing through the points u and v on a sphere:
GreatCircle[{u_, v_}, θ_] := RotationTransform[θ, {u, v}][Normalize[u]];The great circle passing through {1,-1,1}/√3 and {1,1,1}/√3 :
{u, v} = Normalize /@ {{1, -1, 1}, {1, 1, 1}};GreatCircle[{u, v}, θ]//Togetherc = ParametricPlot3D[ Evaluate[GreatCircle[{u, v}, θ]], {θ, 0, 2π}]This shows the great circle and points on the unit sphere:
g = Show[ c, Graphics3D[{PointSize[0.02], Point[{u, v}], Opacity[0.5], Sphere[]}], PlotRange -> All]Using GeometricTransformation:
Show[Graphics3D[{Red, Table[GeometricTransformation[Point[u], RotationTransform[θ, {u, v}]], {θ, 0, 2Pi, 2Pi / 50.}]}],
g]Graphics[Table[GeometricTransformation[Style[Text["Q"], FontSize -> Scaled[1.3]], RotationTransform[a, {0, 1}]], {a, Pi / 5 Range[10]}]]Image Transformations (3)
Rotate an image about its {0,0} origin using RotationTransform:
i = [image];ImageTransformation[i, RotationTransform[10°, {0, 0}]]Rotate about the image center:
ImageTransformation[i, RotationTransform[10°, {0.5, 0.5 ImageAspectRatio[i]}]]Specify a different center of rotation in the standard image coordinate system:
HighlightImage[ImageTransformation[i, RotationTransform[10°, {20, 50}], DataRange -> Full], {PointSize[Large], {20, 50}}]Rotate a 3D image around the
axis:
ImageTransformation[[image], RotationTransform[Pi / 8, {0, 0, 1}]]Rotate a 3D image around the
axis:
ImageTransformation[[image], RotationTransform[Pi / 8, {0, 0, 1}]]Properties & Relations (9)
The rotation transformation is an isometric transform, i.e. preserves distances:
t = RotationTransform[π / 3, {3, 4}];{p1, p2} = {{10, 17}, {1, 2}};
{tp1, tp2} = t[{p1, p2}];EuclideanDistance[p1, p2] == EuclideanDistance[tp1, tp2]//FullSimplifyThe linear part of a rotation transform is given by RotationMatrix:
t = RotationTransform[π / 3, {1, 2, 3}];
m = TransformationMatrix[t][[1 ;; 3, 1 ;; 3]];m == RotationMatrix[π / 3, {1, 2, 3}]The matrix for the linear part is OrthogonalMatrixQ for real rotations:
OrthogonalMatrixQ[m]The inverse of RotationTransform[θ,{u,v}] is RotationTransform[-θ,{u,v}]:
Composition[RotationTransform[θ, {{1, 0, 0}, {0, 0, 1}}],
RotationTransform[-θ, {{1, 0, 0}, {0, 0, 1}}]]//SimplifyThe inverse of RotationTransform[θ,{u,v}] is RotationTransform[θ,{v,u}]:
Composition[RotationTransform[θ, {{1, 0, 0}, {0, 0, 1}}],
RotationTransform[θ, {{0, 0, 1}, {1, 0, 0}}]]//SimplifyIf u or v is not real, the relationship is more complex:
Composition[RotationTransform[Pi / 3, {{1, 0, 1}, {1 + I, 0, 1}}],
RotationTransform[Pi / 3, {{1 + I, 0, 1}, {1, 0, 1}}]]//SimplifyThe inverse of RotationTransform[θ] is given by RotationTransform[-θ]:
Composition[RotationTransform[θ], RotationTransform[-θ]]//SimplifyThe inverse of RotationTransform[θ,w] is given by RotationTransform[-θ,w]:
Composition[RotationTransform[θ, {0, 0, 1}], RotationTransform[-θ, {0, 0, 1}]]//SimplifyThe inverse of RotationTransform[θ,w] is also given by RotationTransform[θ,-w]:
Composition[RotationTransform[θ, {0, 0, 1}], RotationTransform[θ, -{0, 0, 1}]]//SimplifyIf w is not real, the relationship is more complex:
Composition[RotationTransform[θ, {1, I, 0}], RotationTransform[θ, -{1, I, 0}]]//SimplifyThe composition of rotations is a rotation:
Composition[RotationTransform[Pi / 2, {1, 0, 0}], RotationTransform[Pi / 2, {0, 0, 1}]] ==
RotationTransform[2Pi / 3, {1, -1, 1}]For graphics transformation, use Rotate:
{Graphics[Rotate[Rectangle[], Pi / 6, {0, 0}]], Graphics[GeometricTransformation[Rectangle[], RotationTransform[Pi / 6]]]}{Graphics3D[Rotate[Cuboid[], Pi / 6, {0, 0, 1}, {0, 0, 0}]], Graphics3D[GeometricTransformation[Cuboid[], RotationTransform[Pi / 6, {0, 0, 1}]]]}Possible Issues (1)
The order in which rotations are applied is important:
rx = RotationTransform[θ, {1, 0, 0}];
ry = RotationTransform[ϕ, {0, 1, 0}];Compare the results of the two possible orders; the result is not zero:
Composition[rx, ry][{x, y, z}] - Composition[ry, rx][{x, y, z}]Neat Examples (1)
Rotate a 3D object about a point p:
cow = ExampleData[{"Geometry3D", "Cow"}, "GraphicsComplex"];p = {0, 0, -0.251619};Rotate around the
axis, in the
plane:
Graphics3D[{EdgeForm[None], Opacity[0.5], Table[{Lighter[ColorData[1, k + 2], 0.5], GeometricTransformation[cow, RotationTransform[k Pi / 8, {1, 0, 0}, p]]}, {k, -1, 1}]}, Lighting -> "Neutral", ImageSize -> Large, Boxed -> False]Rotate around the
axis, in the
plane:
Graphics3D[{EdgeForm[None], Opacity[0.5], Table[{Lighter[ColorData[1, k + 2], 0.5], GeometricTransformation[cow, RotationTransform[k Pi / 8, {0, 1, 0}, p]]}, {k, -1, 1}]}, Lighting -> "Neutral", ImageSize -> Large, Boxed -> False]Rotate around the
axis, in the
plane:
Graphics3D[{EdgeForm[None], Opacity[0.5], Table[{Lighter[ColorData[1, k + 2], 0.5], GeometricTransformation[cow, RotationTransform[k Pi / 8, {0, 0, 1}, p]]}, {k, -1, 1}]}, Lighting -> "Neutral", ImageSize -> Large, Boxed -> False]Related Workflows
- Rotate, Pan and Zoom 3D Graphics
Related Demonstrations
History
Text
Wolfram Research (2007), RotationTransform, Wolfram Language function, https://reference.wolfram.com/language/ref/RotationTransform.html.
CMS
Wolfram Language. 2007. "RotationTransform." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RotationTransform.html.
APA
Wolfram Language. (2007). RotationTransform. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RotationTransform.html
BibTeX
@misc{reference.wolfram_2026_rotationtransform, author="Wolfram Research", title="{RotationTransform}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/RotationTransform.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rotationtransform, organization={Wolfram Research}, title={RotationTransform}, year={2007}, url={https://reference.wolfram.com/language/ref/RotationTransform.html}, note=[Accessed: 12-June-2026]}