Open richard-uk1 opened 6 years ago
An alternative is some method on a matrix that takes a vector and applies it in this way.
Yeah, originally I was thinking this would be a nice optimization! I don't currently do it though. It's also a handy invariant to know in some cases, but again, I haven't taken advantage of it. Lots of unfinished business on cgmath - if you want to chat further I'm on Gitter!
Multiplying by a diagonal matrix is faster than a general matrix, because it is equivalent to scaling rows if mat diag, or columns if diag mat. Should there be a DiagonalMatrix stored as a vector that implements matrix mult like this to be faster?
An application, for example, is scaling in a rotation/scale/translation transformation.