question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Math.Matrix.append multiplies matrices instead of appending

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
GoodBoyDigitalcommented, Nov 20, 2020

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

0reactions
ShukantPalcommented, Dec 5, 2020
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found