Matrix3 { public float[] transposeToArray(float[] result, int offset) { if (result == null || result.length - offset < 9) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Matrix4", "transposeToArray", "missingResult")); } result[offset++] = (float) this.m[0]; result[offset++] = (float) this.m[3]; result[offset++] = (float) this.m[6]; result[offset++] = (float) this.m[1]; result[offset++] = (float) this.m[4]; result[offset++] = (float) this.m[7]; result[offset++] = (float) this.m[2]; result[offset++] = (float) this.m[5]; result[offset] = (float) this.m[8]; return result; } Matrix3();  Matrix3(double m11, double m12, double m13,
                   double m21, double m22, double m23,
                   double m31, double m32, double m33);  Matrix3(Matrix3 matrix); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Matrix3 set(double m11, double m12, double m13,
                       double m21, double m22, double m23,
                       double m31, double m32, double m33); Matrix3 set(Matrix3 matrix); Matrix3 setTranslation(double x, double y); Matrix3 setRotation(double angleDegrees); Matrix3 setScale(double xScale, double yScale); Matrix3 setToIdentity(); Matrix3 setToTranslation(double x, double y); Matrix3 setToRotation(double angleDegrees); Matrix3 setToScale(double xScale, double yScale); Matrix3 setToVerticalFlip(); Matrix3 setToTileTransform(Sector src, Sector dst); Matrix3 setToMultiply(Matrix3 a, Matrix3 b); Matrix3 multiplyByTranslation(double x, double y); Matrix3 multiplyByRotation(double angleDegrees); Matrix3 multiplyByScale(double xScale, double yScale); Matrix3 multiplyByVerticalFlip(); Matrix3 multiplyByTileTransform(Sector src, Sector dst); Matrix3 multiplyByMatrix(Matrix3 matrix); Matrix3 multiplyByMatrix(double m11, double m12, double m13,
                                    double m21, double m22, double m23,
                                    double m31, double m32, double m33); Matrix3 transpose(); Matrix3 transposeMatrix(Matrix3 matrix); float[] transposeToArray(float[] result, int offset); Matrix3 invert(); Matrix3 invertMatrix(Matrix3 matrix); final double[] m; }
@Test public void testTransposeToArray() throws Exception { Matrix3 m1 = new Matrix3(11d, 12d, 13d, 21d, 22d, 23d, 31d, 32d, 33d); float[] result = m1.transposeToArray(new float[9], 0); double[] expected = m1.transpose().m; for (int i = 0; i < 9; i++) { assertEquals(Integer.toString(i), expected[i], result[i], 0d); } }