How does Mathematica implement ShearingMatrix?

In other words given the parameters $\theta$, $n$ and $v$, what is the formula behind it?

  • $\begingroup$ ShearingMatrix evaluates for symbolic inputs. While it won't display the general formula used, it will show its particular expression for a given dimension. For instance in 2D, one can evaluate ShearingMatrix[\[Theta], {u1, u2}, {v1, v2}]. $\endgroup$
    – user31159
    Commented Oct 27, 2016 at 1:10
  • $\begingroup$ The general formula can be found with some spelunking: <<GeneralUtilities`; PrintDefinitions[ShearingMatrix]. $\endgroup$
    – user31159
    Commented Oct 27, 2016 at 1:11
  • $\begingroup$ @xavier This doesn't seem to work in Mathematica 10. It does nothing. $\endgroup$
    – plasmacel
    Commented Oct 27, 2016 at 1:45
  • 1
    $\begingroup$ Ah OK, PrintDefinitions is from 10.1. You could have a look there for other spelunking tools. $\endgroup$
    – user31159
    Commented Oct 27, 2016 at 9:34
  • $\begingroup$ @xavier I tried this in 10.1 and it helped a lot, thanks. $\endgroup$
    – plasmacel
    Commented Oct 27, 2016 at 12:10

1 Answer 1


The code of symbols implemented in top-level can be seen by using PrintDefinitions.

For ShearingMatrix, one can evaluate


and then click on System`TransformConstructorDump`iShearingMatrix to view the formula used.

PrintDefinitions is available from version 10.1. For earlier versions of Mathematica, other spelunking tools can be found in this post.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.