You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[geometry-1] TYPO? 2.1(6) should be pre-multiply ,not post-multiply. #294
Step 6 of Section 2.1Transforming a point with a matrix, says
Set pointVector to pointVector post-multiplied by matrix.
pointVector was defined as a column vector in the previous step. And the definition of post-multiply is:
Term A post-multiplied by term B is equal to A · B.
So that's pointVector · matrix; i.e. columnVector · matrix
That's not mathematically possible. Matrix multiplication produces a new matrix whose elements are the inner products of the left-hand matrix's rows with the right-hand's columns; so for C = A · B
A 4-element column vector multiplied by a 4x4 matrix means calculating the dot product of a 1-element row with a 4-element column. There's no way to do it.
The text should say
Set pointVector to pointVector pre-multiplied by matrix.
or
Set pointVector to matrix post-multiplied by pointVector.
or it should construct pointVector as a row vector and post-multiply by the transpose of the matrix.
I've read and re-read the spec, and I can't see I've got this wrong this time. But I've not done a PR in case my eyes have swizzled the words again.
I just ran into this because without this clarification, transformPoint isn't a usable API. (that is, I can't look up the spec and see what's supposed to happen)
I'll put up a PR.
Activity
dirkschulze commentedon Dec 12, 2018
@fuchsia That seems to be an issue, yes.
bzbarsky commentedon Jul 23, 2019
So what happens in browsers seems to be
matrix * columnVector, as far as I can tell.kdashg commentedon Feb 17, 2021
Yes that's what happens: https://jsfiddle.net/zpw1kxjb/4/
kdashg commentedon Feb 17, 2021
I just ran into this because without this clarification, transformPoint isn't a usable API. (that is, I can't look up the spec and see what's supposed to happen)
I'll put up a PR.
Column vectors are pre-multiplied by matrices.