6
$\begingroup$

My graphics text explains rotating along the cardinal axes, then generalizes the math to show how to make a rotation matrix for rotating around an arbitrary vector. That all makes sense and I can both follow the math and picture the operations.

Then the text discusses scaling uniformly and in cardinal directions. Again I can follow everything. But then it goes through the math for "scaling in an arbitrary direction", and although I can follow the vector operations I don't understand what scaling in a non cardinal direction even means. I can start with an object rotated "right side up", and then imagine it getting wider/taller/deeper, but I don't understand what it would mean to scale it in an arbitrary direction.

My first thought was they must just mean scaling each cardinal direction by a different amount, but that can't be right because they don't end up with a diagonal matrix (take the identity matrix, change the first row 1 to 5 and the second row 1 to 3, and now you have a matrix that scales x by 5 and y by 3). Their 2D general scaling matrix is below.

enter image description here

$\endgroup$

1 Answer 1

7
$\begingroup$

When you scale along the X-axis, the X-coordinate (parallel to the axis) gets stretched, while the Y-coordinate (perpendicular to the axis) remains the same. You can think of scaling along an arbitrary axis as stretching along some diagonal.

Here's a pic of a square being scaled along the main diagonal (the axis pointing to <1, 1> ) by factors of 2 and 0.5.

enter image description here

You can see that the distance along the axis (green line) gets scaled while the perpendicular distance (red line) stays the same.

Mathematically, this is the same as rotating until your chosen axis lies along the X-axis, scaling by X, then rotating back again.

$\endgroup$
3
  • $\begingroup$ How did you make the diagram? $\endgroup$ Sep 9, 2017 at 18:34
  • $\begingroup$ I used Processing, good for quick and dirty sketches like this :) $\endgroup$
    – russ
    Sep 10, 2017 at 10:33
  • $\begingroup$ Athough nearly anything could have worked. You could have used almost anykind of toolset to do this in less than 5 minutes. You could have used a editor like inkscape or illustrator, you could have written postscript, svg, TeX or javascript in a browser even webGL in that time. $\endgroup$
    – joojaa
    Sep 10, 2017 at 13:31

Your Answer

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

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