Examples of Matrix4


Examples of jinngine.math.Matrix4

                    0., 0., 0., 1.}, i, 1E-15);
    }

    @Test
    public void testInverse02() {
        Matrix4 m = new Matrix4(
                1., 0., 0., 0.,
                0., 1., 0., 0.,
                0., 0., 1., 0.,
                0., 0., 0., 1.);
        Matrix4 r = m.inverse();
        assertMatrixEquals(new double[]{
                    1., 0., 0., 0.,
                    0., 1., 0., 0.,
                    0., 0., 1., 0.,
                    0., 0., 0., 1.}, r, 1E-15);
View Full Code Here

Examples of jinngine.math.Matrix4

    }

    @Test
    public void testToArray() {

        final Matrix4 m = new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        final double[] d = m.toArray();
        final double[] d2 = m.toArray();
        assertNotSame(
                d, d2);
        assertMatrixEquals(
                new double[]{
                    1., 2., 3., 4.,
View Full Code Here

Examples of jinngine.math.Matrix4

    @Test
    public void testToString() {
        assertEquals("[1.0, 2.0, 3.0, 4.0]\n"
                + "[5.0, 6.0, 7.0, 8.0]\n"
                + "[9.0, 10.0, 11.0, 12.0]\n"
                + "[13.0, 14.0, 15.0, 16.0]", new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16).toString());
    }
View Full Code Here

Examples of jinngine.math.Matrix4

        assertMatrixEquals(ref, val, 0.);
    }

    @Test
    public void testCtorZero() {
        final Matrix4 m = new Matrix4();
        assertMatrixEquals(new double[]{
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,}, m);
View Full Code Here

Examples of jinngine.math.Matrix4

                    0., 0., 0., 0.,}, m);
    }

    @Test
    public void testAssignZero() {
        final Matrix4 m = new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        final Matrix4 r = m.assignZero();
        assertSame(r, m);//assert it return this
        //assert every value is 0.
        assertMatrixEquals(new double[]{
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
View Full Code Here

Examples of jinngine.math.Matrix4

                    0., 0., 0., 0.,}, m);
    }

    @Test
    public void testCtorD() {
        final Matrix4 m = new Matrix4(new double[]{
                    1., 2., 3., 4.,
                    5., 6., 7., 8.,
                    9., 10, 11, 12,
                    13, 14, 15, 16});
        assertMatrixEquals(new double[]{
View Full Code Here

Examples of jinngine.math.Matrix4

                    4., 8., 12, 16}, m);
    }

    @Test
    public void testAssignD() {
        final Matrix4 m = new Matrix4();
        final Matrix4 r = m.assign(new double[]{
                    1., 2., 3., 4.,
                    5., 6., 7., 8.,
                    9., 10, 11, 12,
                    13, 14, 15, 16});
        assertSame(r, m);//assert it return this
View Full Code Here

Examples of jinngine.math.Matrix4

                    4., 8., 12, 16}, m);
    }

    @Test
    public void testCtor() {
        final Matrix4 m = new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        assertMatrixEquals(new double[]{
View Full Code Here

Examples of jinngine.math.Matrix4

                    13, 14, 15, 16}, m);
    }

    @Test
    public void testAssign() {
        final Matrix4 m = new Matrix4();
        final Matrix4 r = m.assign(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        assertSame(r, m);//assert it return this
View Full Code Here

Examples of jinngine.math.Matrix4

                    13, 14, 15, 16}, m);
    }

    @Test
    public void testCtorMatrix() {
        final Matrix4 m = new Matrix4(new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.