Returns the transpose of a 4x4 matrix : Matrix « Game « Android

Home
Android
1.2D Graphics
2.Animation
3.Core Class
4.Database
5.Date Type
6.Development
7.File
8.Game
9.Hardware
10.Media
11.Network
12.Security
13.UI
14.User Event
Android » Game » Matrix 
Returns the transpose of a 4x4 matrix
 
class Main{
      /**
       * Returns the transpose of a 4x4 matrix
       @param m The matrix to transpose
       @param result The place to store the transposed matrix
       **/
      public static void transpose(float[][] m, float[][] result) {
    for (int i=0;i<4;i++)
        for (int j=0;j<4;j++)
      result[j][i= m[i][j];
      }

      public static void transpose(float[]m, float[] result) {
        for (int i=0;i<4;i++)
            for (int j=0;j<4;j++)
          result[j*4+i= m[i*4+j];
      }


}

   
  
Related examples in the same category
1.How to implement a Matrix Palette
2.Matrix Operations
3.Rotate Matrix
4.Matrix Utils
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.