Package 

Class MatrixMathHelper


  • 
    public class MatrixMathHelper
    
                        

    Provides helper methods for converting transform operations into a matrix and then into a list of translate, scale and rotate commands.

    • Method Detail

      • inverse

         static Array<double> inverse(Array<double> matrix)

        Inverse of a matrix. Multiplying by the inverse is used in matrix math instead of division.

        Formula from:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm

      • transpose

         static Array<double> transpose(Array<double> m)

        Turns columns into rows and rows into columns.

      • multiplyVectorByMatrix

         static void multiplyVectorByMatrix(Array<double> v, Array<double> m, Array<double> result)

        Based on: http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c

      • v3Length

         static double v3Length(Array<double> a)

        From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js

      • v3Normalize

         static Array<double> v3Normalize(Array<double> vector, double norm)

        Based on: https://code.google.com/p/webgl-mjs/source/browse/mjs.js

      • v3Dot

         static double v3Dot(Array<double> a, Array<double> b)

        The dot product of a and b, two 3-element vectors. From:https://code.google.com/p/webgl-mjs/source/browse/mjs.js

      • v3Combine

         static Array<double> v3Combine(Array<double> a, Array<double> b, double aScale, double bScale)

        From:http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp

      • v3Cross

         static Array<double> v3Cross(Array<double> a, Array<double> b)

        From:http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp