News for hackers. Stuff that matters.
Re:Relearning Matrices as Linear Functions by wolfgke on Tuesday April 23, 2019 @04:21PM (#19732428)
Shearings cannot be represented in this way.
Re:Relearning Matrices as Linear Functions by throwawaymath on Tuesday April 23, 2019 @05:42PM (#19733207)
Yes they can. This follows from singular value decomposition. Let S be the matrix representation of a shear transformation. There exist rotation matrices R, B and a diagonal matrix D such that S = RDC, where C is the transpose of B. D is the matrix representation of a scaling transformation and R, B are the matrix representations of rotation transformations. Since S is a product of rotation and scaling matrices, its corresponding linear transformation is a composition of rotations and scalings.

It would ordinarily be weird to represent shear transformations using rotations and scalings because shear matrices are elementary. But it checks out.

Re:Relearning Matrices as Linear Functions by wolfgke on Tuesday April 23, 2019 @06:11PM (#19733477)
OK, point taken. I considered "scaling" in a less general sense (scalar multiple of the unit matrix), while you want to allow arbitrary diagonal entries. My definition is to my knowledge the common one in linear algebra textbooks because in yours, the feasible maps depend on the chosen basis.

EDIT: To state my point more clearly: in textbooks, "scaling" is the linear map that is induced by the "scalar multiplication" in the definition of the vector space (that is why both terms start with "scal").

Re:Relearning Matrices as Linear Functions by magicalhippo on Tuesday April 23, 2019 @08:21PM (#19734385)
Reminds me of the old "hack" to use three shear transformations to rotate an image.

The idea being that a shear is relatively much faster on weaker CPUs, relative to doing a "proper" (reverse mapping) rotation.

A nice write-up can be found here: https://www.ocf.berkeley.edu/~fricke/projects/israel/paeth/r...

Re:Relearning Matrices as Linear Functions by rocqua on Tuesday April 23, 2019 @05:27PM (#19733062)
Notably though, shearings are very 'rare'. Any pertubation will make a shearing no longer a shearing. At least, if I remember correctly.
Re:Relearning Matrices as Linear Functions by blt on Wednesday April 24, 2019 @04:23AM (#19736513)
Same for the the orthogonal matrices, or the diagonal matrices, or the symmetric matrices, or the unit determinant matrices, or the singular matrices ... They are all sets of Lebesgue measure zero.
Re:Relearning Matrices as Linear Functions by rocqua on Wednesday April 24, 2019 @04:53AM (#19736645)
Orthogonal, diagonal, symmetric, and unit-determinant matrices are all sub-groups though, which makes them 'more special' then all shearing matrices.

Singular matrices are special in the sense that they keep the matrix monoid from being a group. My category theory isn't strong enough to characterize it, but this probably also has a name.

Edit: I think the singular matrices are the 'kernel' of the right adjoint of the forgetful functor from the category of groups to the category of monoids. Though I must admit a lot of that sentence is my stringing together words I only vaguely know.

Re:Relearning Matrices as Linear Functions by munchbunny on Tuesday April 23, 2019 @04:50PM (#19732706)
They can if you add a dimension to the space. That's one of the reasons 3d graphics use 4d vectors and matrices.
Re:Relearning Matrices as Linear Functions by bonoboTP on Tuesday April 23, 2019 @05:00PM (#19732808)
You're talking about translation.
Re:Relearning Matrices as Linear Functions by munchbunny on Tuesday April 23, 2019 @05:19PM (#19732988)
No, I wasn't, but I did confuse the terms. Shear can be done without the extra dimension. Skew transforms require the extra dimension, as does translation.
Re:Relearning Matrices as Linear Functions by bonoboTP on Wednesday April 24, 2019 @11:04AM (#19739053)
What do you mean by skew? A perspective transformation (homography)? I'm not sure it's standard terminology.