Prints the given 4x4 matrix to LogCat (info priority). - Android android.graphics

Android examples for android.graphics:Matrix

Description

Prints the given 4x4 matrix to LogCat (info priority).

Demo Code


//package com.java2s;

import android.util.Log;

public class Main {
    /**//from   ww w .  ja  va 2s. c  om
     * Prints the given 4x4 matrix to LogCat (info priority).
     * @param array
     */
    public static void printMatrix(float[] array) {
        Log.i("MATRIX", "[ " + array[0] + ", " + array[4] + ", " + array[8]
                + ", " + array[12]);
        Log.i("MATRIX", "  " + array[1] + ", " + array[5] + ", " + array[9]
                + ", " + array[13]);
        Log.i("MATRIX", "  " + array[2] + ", " + array[6] + ", "
                + array[10] + ", " + array[14]);
        Log.i("MATRIX", "  " + array[3] + ", " + array[7] + ", "
                + array[11] + ", " + array[15] + " ]");
    }
}

Related Tutorials