How to stack rotation matrices to operate on a matrix of samples?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I can operate on a $3times 1$ vector, $a$, with a $3times 3$ rotation matrix, $r$. Such that $r a=b$, another $3times 1$ vector.



If I have $N$ of these vectors and rotation matrices I can stack them to create matrix $A$ with dimension $3times N$ and matrix $R$ with dimension $3times 3times N$. Is there a way to make $R$ a $Ntimes N$ matrix that preserves its information? So that I can operate on $A$ from the right to find $B$? or $A^T$ from the left to find $B^T$







share|cite|improve this question





















  • Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
    – saulspatz
    Jul 31 at 20:14














up vote
0
down vote

favorite












I can operate on a $3times 1$ vector, $a$, with a $3times 3$ rotation matrix, $r$. Such that $r a=b$, another $3times 1$ vector.



If I have $N$ of these vectors and rotation matrices I can stack them to create matrix $A$ with dimension $3times N$ and matrix $R$ with dimension $3times 3times N$. Is there a way to make $R$ a $Ntimes N$ matrix that preserves its information? So that I can operate on $A$ from the right to find $B$? or $A^T$ from the left to find $B^T$







share|cite|improve this question





















  • Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
    – saulspatz
    Jul 31 at 20:14












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I can operate on a $3times 1$ vector, $a$, with a $3times 3$ rotation matrix, $r$. Such that $r a=b$, another $3times 1$ vector.



If I have $N$ of these vectors and rotation matrices I can stack them to create matrix $A$ with dimension $3times N$ and matrix $R$ with dimension $3times 3times N$. Is there a way to make $R$ a $Ntimes N$ matrix that preserves its information? So that I can operate on $A$ from the right to find $B$? or $A^T$ from the left to find $B^T$







share|cite|improve this question













I can operate on a $3times 1$ vector, $a$, with a $3times 3$ rotation matrix, $r$. Such that $r a=b$, another $3times 1$ vector.



If I have $N$ of these vectors and rotation matrices I can stack them to create matrix $A$ with dimension $3times N$ and matrix $R$ with dimension $3times 3times N$. Is there a way to make $R$ a $Ntimes N$ matrix that preserves its information? So that I can operate on $A$ from the right to find $B$? or $A^T$ from the left to find $B^T$









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Aug 1 at 21:32









Mauricio Cele Lopez Belon

54728




54728









asked Jul 31 at 19:23









Ian Campbell Moore

34




34











  • Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
    – saulspatz
    Jul 31 at 20:14
















  • Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
    – saulspatz
    Jul 31 at 20:14















Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
– saulspatz
Jul 31 at 20:14




Please use MathJax to format your questions. You'll get a lot more readership if you do, I think.
– saulspatz
Jul 31 at 20:14










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Short answer is almost. The long answer requires to do some precisions:



First, if you "stack" a $3 times 1$ column vector $N$ times you get a $3N times 1$ column vector, not a $3 times N$ matrix.



Second, the matrix $R$ should be $3N times 3N$ square matrix, as it has $N$ number of $3 times 3$ matrices on its diagonal and zeros everywhere esle.



So if you stack your $N$ vectors in a $3N times 1$ vectot $A$ and arrange your matrix $R$ of dimension $3N times 3N$ as described above you will get $ R A = B$ and $ A = R^T B$ as you want.



TL;DR



Now that will be extremely slow in a computer. In order to do better you will need to use sparse matrix multiplication since the matrix $R$ is sparse. However, I think doing the individual $3 times 3$ matrix multiplication with a $3 times 1$ column vector will be much faster since modern linear algebra libraries use vectorized instructions for those tiny matrices which would reduce the multiplication time by a factor of four.






share|cite|improve this answer





















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2868386%2fhow-to-stack-rotation-matrices-to-operate-on-a-matrix-of-samples%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Short answer is almost. The long answer requires to do some precisions:



    First, if you "stack" a $3 times 1$ column vector $N$ times you get a $3N times 1$ column vector, not a $3 times N$ matrix.



    Second, the matrix $R$ should be $3N times 3N$ square matrix, as it has $N$ number of $3 times 3$ matrices on its diagonal and zeros everywhere esle.



    So if you stack your $N$ vectors in a $3N times 1$ vectot $A$ and arrange your matrix $R$ of dimension $3N times 3N$ as described above you will get $ R A = B$ and $ A = R^T B$ as you want.



    TL;DR



    Now that will be extremely slow in a computer. In order to do better you will need to use sparse matrix multiplication since the matrix $R$ is sparse. However, I think doing the individual $3 times 3$ matrix multiplication with a $3 times 1$ column vector will be much faster since modern linear algebra libraries use vectorized instructions for those tiny matrices which would reduce the multiplication time by a factor of four.






    share|cite|improve this answer

























      up vote
      0
      down vote



      accepted










      Short answer is almost. The long answer requires to do some precisions:



      First, if you "stack" a $3 times 1$ column vector $N$ times you get a $3N times 1$ column vector, not a $3 times N$ matrix.



      Second, the matrix $R$ should be $3N times 3N$ square matrix, as it has $N$ number of $3 times 3$ matrices on its diagonal and zeros everywhere esle.



      So if you stack your $N$ vectors in a $3N times 1$ vectot $A$ and arrange your matrix $R$ of dimension $3N times 3N$ as described above you will get $ R A = B$ and $ A = R^T B$ as you want.



      TL;DR



      Now that will be extremely slow in a computer. In order to do better you will need to use sparse matrix multiplication since the matrix $R$ is sparse. However, I think doing the individual $3 times 3$ matrix multiplication with a $3 times 1$ column vector will be much faster since modern linear algebra libraries use vectorized instructions for those tiny matrices which would reduce the multiplication time by a factor of four.






      share|cite|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Short answer is almost. The long answer requires to do some precisions:



        First, if you "stack" a $3 times 1$ column vector $N$ times you get a $3N times 1$ column vector, not a $3 times N$ matrix.



        Second, the matrix $R$ should be $3N times 3N$ square matrix, as it has $N$ number of $3 times 3$ matrices on its diagonal and zeros everywhere esle.



        So if you stack your $N$ vectors in a $3N times 1$ vectot $A$ and arrange your matrix $R$ of dimension $3N times 3N$ as described above you will get $ R A = B$ and $ A = R^T B$ as you want.



        TL;DR



        Now that will be extremely slow in a computer. In order to do better you will need to use sparse matrix multiplication since the matrix $R$ is sparse. However, I think doing the individual $3 times 3$ matrix multiplication with a $3 times 1$ column vector will be much faster since modern linear algebra libraries use vectorized instructions for those tiny matrices which would reduce the multiplication time by a factor of four.






        share|cite|improve this answer













        Short answer is almost. The long answer requires to do some precisions:



        First, if you "stack" a $3 times 1$ column vector $N$ times you get a $3N times 1$ column vector, not a $3 times N$ matrix.



        Second, the matrix $R$ should be $3N times 3N$ square matrix, as it has $N$ number of $3 times 3$ matrices on its diagonal and zeros everywhere esle.



        So if you stack your $N$ vectors in a $3N times 1$ vectot $A$ and arrange your matrix $R$ of dimension $3N times 3N$ as described above you will get $ R A = B$ and $ A = R^T B$ as you want.



        TL;DR



        Now that will be extremely slow in a computer. In order to do better you will need to use sparse matrix multiplication since the matrix $R$ is sparse. However, I think doing the individual $3 times 3$ matrix multiplication with a $3 times 1$ column vector will be much faster since modern linear algebra libraries use vectorized instructions for those tiny matrices which would reduce the multiplication time by a factor of four.







        share|cite|improve this answer













        share|cite|improve this answer



        share|cite|improve this answer











        answered Aug 1 at 21:51









        Mauricio Cele Lopez Belon

        54728




        54728






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2868386%2fhow-to-stack-rotation-matrices-to-operate-on-a-matrix-of-samples%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What is the equation of a 3D cone with generalised tilt?

            Color the edges and diagonals of a regular polygon

            Relationship between determinant of matrix and determinant of adjoint?