ShearingMatrix[θ,v,n]
gives the matrix corresponding to shearing by θ radians along the direction of the vector v, and normal to the vector n.
ShearingMatrix
ShearingMatrix[θ,v,n]
gives the matrix corresponding to shearing by θ radians along the direction of the vector v, and normal to the vector n.
Details
- ShearingMatrix gives matrices corresponding to shearing with the origin kept fixed.
- ShearingMatrix gives matrices with determinant 1, corresponding to area- or volume-preserving transformations.
- In 2D, ShearingMatrix turns rectangles into parallelograms. ShearingMatrix[θ,{1,0},{0,1}] effectively slants by angle θ to the right.
- In 3D, ShearingMatrix does the analog of shearing a deck of cards by angle θ in the direction v, with the cards being oriented so as to have normal vector n.
Examples
open all close allBasic Examples (2)
Scope (5)
ShearingMatrix[θ, {1, 0}, {0, 1}]//MatrixFormShearingMatrix[θ, {0, 1}, {1, 0}]//MatrixFormShearing in the
plane along the
axis:
ShearingMatrix[θ, {1, 0, 0}, {0, 0, 1}]//MatrixFormShearing the
plane along the
axis:
ShearingMatrix[θ, {1, 0, 0}, {0, 1, 0}]//MatrixFormA shearing by angle
in the
direction in the line
:
ShearingMatrix[θ, {1, 1}, {1, -1}]//MatrixFormTransformation 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}, ShearingMatrix[Pi / 6, {1, 0}, {0, 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}, ShearingMatrix[Pi / 4, {1, 0, 0}, {-1, 1, 0}]]}, Boxed -> False]Applications (2)
Applying the transformation to a surface:
Plot3D[-Sin[x y], {x, 0, Pi}, {y, 0, Pi}, BoxRatios -> Automatic, PlotRange -> All] /. gc_GraphicsComplex :> GeometricTransformation[gc, ShearingMatrix[-Pi / 4, {1, 1, 0}, {0, 0, 1}]]Generate all simple (directions parallel to axes) shearing matrices for dimension n:
Shearings[θ_, n_] :=
With[{pairs = Subsets[Table[ UnitVector[n, j], {j, n}], {2}]}, Map[ShearingMatrix[θ, #[[1]], #[[2]]]&, Join[pairs, Reverse /@ pairs]]];Map[ MatrixForm, Shearings[θ, 2]]Map[Framed@Graphics[GeometricTransformation[Rectangle[], #], PlotRange -> {{0, 1.6}, {0, 1.6}}]&, Shearings[Pi / 6, 2]]Map[ MatrixForm, Shearings[θ, 3]]Map[Graphics3D[GeometricTransformation[Cuboid[], #]]&, Shearings[Pi / 6, 3]]Map[ MatrixForm, Shearings[θ, 4]]Properties & Relations (4)
The determinant of a shearing matrix is 1; hence it preserves areas and volumes:
Det[ ShearingMatrix[θ, {1, 0, 0}, {0, 0, 1}]]The inverse of ShearingMatrix[θ,v,n] is given by ShearingMatrix[-θ,v,n]:
ShearingMatrix[θ, {1, 0, 0}, {0, 0, 1}].ShearingMatrix[-θ, {1, 0, 0}, {0, 0, 1}]The inverse of ShearingMatrix[θ,v,n] is also given by ShearingMatrix[θ,-v,n]:
ShearingMatrix[θ, {1, 0, 0}, {0, 0, 1}].ShearingMatrix[θ, -{1, 0, 0}, {0, 0, 1}]The ![]()
power of a shearing matrix is again a shearing matrix with the same
and
:
MatrixPower[ShearingMatrix[a, {1, 0}, {0, 1}], n] == ShearingMatrix[ArcTan[n Tan[a]], {1, 0}, {0, 1}]Possible Issues (3)
The order in which shearings are applied is significant:
t1 = ShearingMatrix[θ, {1, 0, 0}, {0, 0, 1}];
t2 = ShearingMatrix[ϕ, {1, 0, 0}, {-1, 1, 0}];Here the two different orders do not yield the same matrix:
t1.t2 - t2.t1//SimplifyThe transformation is not defined for angles
such that
:
Limit[ShearingMatrix[a, {1, 0, 0}, {0, 0, 1}], a -> Pi / 2]For non-orthogonal vectors, the direction is determined by the projection of the direction vector:
ShearingMatrix[a, {1, 0}, {1, 1}] == ShearingMatrix[a, Projection[{1, 0}, Cross[{1, 1}]], {1, 1}]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), ShearingMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/ShearingMatrix.html.
CMS
Wolfram Language. 2007. "ShearingMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ShearingMatrix.html.
APA
Wolfram Language. (2007). ShearingMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ShearingMatrix.html
BibTeX
@misc{reference.wolfram_2026_shearingmatrix, author="Wolfram Research", title="{ShearingMatrix}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ShearingMatrix.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_shearingmatrix, organization={Wolfram Research}, title={ShearingMatrix}, year={2007}, url={https://reference.wolfram.com/language/ref/ShearingMatrix.html}, note=[Accessed: 12-June-2026]}