package matrixMath; public class matrixMath { /** * The x component of the vector. */ public float x; /** * The y component of the vector. */ public float y; /** * The z component of the vector. */ public float z; public float give; private float matrix[][]; private float length; public int rows; public int colm; /** * Constructor for a 3D vector. * * @param x_ the x coordinate. * @param y_ the y coordinate. * @param z_ the y coordinate. */ public matrixMath(float matrix_[][]) { matrix = matrix_; x = matrix[0][0]; y = matrix[0][1]; z = matrix[0][2]; } public void setNumber(int i, int j, float aa){ matrix[i][j]=aa; } public static float value; public float getNumber(int i, int j){ give = matrix[i][j]; return give; } public static float row; public int sizeRow(){ rows = matrix.length; colm = matrix[0].length; return rows; } public int sizeCol(){ rows = matrix.length; colm = matrix[0].length; return colm; } public static float col; public float numberOfcol(matrixMath x){ col = x.length; return col; } public matrixMath() { x = 0f; y = 0f; z = 0f; } public matrixMath copy() { return new matrixMath(matrix); } public static float newMatrix[][]; public matrixMath buildMatrx(int row, int col) { rows = row; colm = col; if(newMatrix==null) { newMatrix = new float[row][col]; } for ( int c=0; c> add function is for testing operations1*/ public static float scalePoint[][]; public static float returnPoint[]; public static float returnPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath scalePoint(matrixMath x,int scaleX, int scaleY, int scaleZ) { if(scalePoint==null) { scalePoint = new float[x.sizeRow()][4]; returnPoint = new float[4]; returnPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float transPoint[][]; public static float returnAPoint[]; public static float returnAPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath transPoint(matrixMath x,int transX, int transY, int transZ) { if(transPoint==null) { transPoint = new float[x.sizeRow()][4]; returnAPoint = new float[4]; returnAPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float shearXPoint[][]; public static float returnBPoint[]; public static float returnBPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath shearPoint(matrixMath x,int shearX, int shearY, int shearZ) { if(shearXPoint==null) { shearXPoint = new float[x.sizeRow()][4]; returnBPoint = new float[4]; returnBPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float rotateXPoint[][]; public static float returnDPoint[]; public static float returnDPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath rotateXPoint(matrixMath x,int rotX) { if(rotateXPoint==null) { rotateXPoint = new float[x.sizeRow()][4]; returnDPoint = new float[4]; returnDPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float rotateYPoint[][]; public static float returnEPoint[]; public static float returnEPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath rotateYPoint(matrixMath x,int rotY) { if(rotateYPoint==null) { rotateYPoint = new float[x.sizeRow()][4]; returnEPoint = new float[4]; returnEPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float rotateZPoint[][]; public static float returnFPoint[]; public static float returnFPointTwo[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath rotateZPoint(matrixMath x,int rotZ) { if(rotateYPoint==null) { rotateZPoint = new float[x.sizeRow()][4]; returnFPoint = new float[4]; returnFPointTwo = new float[4][4]; } //set answere matrix to zero for ( int q=0; q> add function is for testing operations1*/ public static float identity[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath identityMatrix(int matrixSize) { /* -->> arr[1][1] = a+b; arr hasn't been initialised, * you're accessing [1][1] when the array is null. Also, * you probably want 0, not 1, since arrays are 0-index */ if(identity==null) { identity=new float[matrixSize][matrixSize]; } for ( int a=0; a> add function is for testing operations1*/ public static float transpose[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath transposeMatrix(matrixMath matrixA) { if(transpose==null) { transpose=new float[matrixA.sizeRow()][matrixA.sizeCol()]; } //set answere matrix to zero for ( int a=0; a> add function is for testing operations1*/ public static float multiply[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath multiplySquareMatrix(matrixMath matrixA, matrixMath matrixB) { if(multiply==null) { multiply=new float[matrixA.sizeRow()][matrixA.sizeCol()]; } //set answere matrix to zero for ( int a=0; a> add function is for testing operations1*/ public static float add[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath addSquareMatrix(matrixMath matrixA, matrixMath matrixB) { if(add==null) { add=new float[matrixA.sizeRow()][matrixA.sizeCol()]; } //set answere matrix to zero for ( int a=0; a> add function is for testing operations1*/ public static float subtract[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath subtractSquareMatrix(matrixMath matrixA, matrixMath matrixB) { if(subtract==null) { subtract=new float[matrixA.sizeRow()][matrixA.sizeCol()]; } //set answere matrix to zero for ( int a=0; a> add function is for testing operations1*/ public static float scale[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath scaleSquareMatrix(matrixMath matrixA, matrixMath matrixB,int scaleFactor) { if(scale==null) { scale=new float[matrixA.sizeRow()][matrixA.sizeCol()]; } //set answere matrix to zero for ( int a=0; a> add function is for testing operations1*/ public static float columnmultiply[][]; /* function for calculating local stiffness Matrix*/ public static matrixMath columnMultiplyMatrix(float matrixA[],matrixMath matrixB) { if(columnmultiply==null) { columnmultiply=new float[1][matrixB.sizeCol()]; } //set answere matrix to zero for ( int a=0; a