Java Matrix Transpose transpose4x4(float m[], float t[])

Here you can find the source of transpose4x4(float m[], float t[])

Description

Transpose the given matrix, and write the result into the given target matrix.

License

Open Source License

Parameter

Parameter Description
m The input matrix
t The target matrix

Declaration

static void transpose4x4(float m[], float t[]) 

Method Source Code

//package com.java2s;
/*//  ww w  . j  av  a 2 s.c om
 * www.javagl.de - JglTF
 *
 * Copyright 2015-2016 Marco Hutter - http://www.javagl.de
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

public class Main {
    /**
     * Transpose the given matrix, and write the result into the given
     * target matrix. 
     * 
     * @param m The input matrix
     * @param t The target matrix
     */
    static void transpose4x4(float m[], float t[]) {
        float m0 = m[0];
        float m1 = m[1];
        float m2 = m[2];
        float m3 = m[3];
        float m4 = m[4];
        float m5 = m[5];
        float m6 = m[6];
        float m7 = m[7];
        float m8 = m[8];
        float m9 = m[9];
        float mA = m[10];
        float mB = m[11];
        float mC = m[12];
        float mD = m[13];
        float mE = m[14];
        float mF = m[15];
        t[0] = m0;
        t[1] = m4;
        t[2] = m8;
        t[3] = mC;
        t[4] = m1;
        t[5] = m5;
        t[6] = m9;
        t[7] = mD;
        t[8] = m2;
        t[9] = m6;
        t[10] = mA;
        t[11] = mE;
        t[12] = m3;
        t[13] = m7;
        t[14] = mB;
        t[15] = mF;
    }
}

Related

  1. transpose(Object[][] matrix)
  2. transpose(Object[][] matrix)
  3. transpose2d(Object[][] array)
  4. transpose2DArray(Double[][] data)
  5. transpose3x3Matrix(float[][] m)
  6. transpose_image(Object source, int width, int height)
  7. transposeBooleanMatrix(boolean[][] matrix)
  8. transposeInPlace(float[] src)
  9. transposeMatrix(double[][] m)