Math.Matrix.append multiplies matrices instead of appending
See original GitHub issueI am reading the source code and I ran into Math.Matrix.append() function which (I think) suppose to add one matrix to another. In the source code, I can see that it does not append but multiply those matrices. Is there any reason for it?
/**
* Appends the given Matrix to this Matrix.
*
* @param {PIXI.Matrix} matrix - The matrix to append.
* @return {PIXI.Matrix} This matrix. Good for chaining method calls.
*/
append(matrix: Matrix): this
{
const a1 = this.a;
const b1 = this.b;
const c1 = this.c;
const d1 = this.d;
this.a = (matrix.a * a1) + (matrix.b * c1);
this.b = (matrix.a * b1) + (matrix.b * d1);
this.c = (matrix.c * a1) + (matrix.d * c1);
this.d = (matrix.c * b1) + (matrix.d * d1);
this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;
this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;
return this;
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Math.Matrix.append multiplies matrices instead of ... - GitHub
I am reading the source code and I ran into Math.Matrix.append() function which (I think) suppose to add one matrix to another.
Read more >Adding & subtracting matrices (video) - Khan Academy
Adding a scalar (or number) to a matrix is not defined. You can multiply a number by a matrix. 1 comment.
Read more >Matrix addition & subtraction (article) | Khan Academy
What you will learn in this lesson. As long as the dimensions of two matrices are the same, we can add and subtract...
Read more >Matrix operations - xaktly.com
In this section we'll learn how to add (and subtract) and multiply matrices and vectors. If you aren't sure about terminology, head back...
Read more >Add and Subtract Matrices & Multiply Matrices by a Scalar - [2]
Matrix Algebra Tutor. Add and Subtract Matrices & Multiply Matrices by a Scalar - [2]. 1.7K views 9 days ago. Math and Science....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ITs been a while! i can’t actually remember where I got the terms from. but append / prepend (at the time) was synonymous with multiply / premultiply
https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix(); yes, the x/y skews are wrong in the comment.