Examples of Matrix3


Examples of jinngine.math.Matrix3

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

    @Test
    public void testColumn01() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Vector3 c1 = m.column(0);
        assertEquals(1., c1.x);
        assertEquals(4., c1.y);
        assertEquals(7., c1.z);
        final Vector3 c2 = m.column(1);
        assertNotSame(c1, c2); // Vector is not recycled
        assertEquals(2., c2.x);
        assertEquals(5., c2.y);
        assertEquals(8., c2.z);
        final Vector3 c3 = m.column(2);
        assertEquals(3., c3.x);
        assertEquals(6., c3.y);
        assertEquals(9., c3.z);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        assertEquals(9., c3.z);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testColumn02() {
        new Matrix3().column(-1);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().column(-1);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testColumn03() {
        new Matrix3().column(3);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().column(3);
    }

    @Test
    public void testRow() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Vector3 r1 = m.row(0);
        assertEquals(1., r1.x);
        assertEquals(2., r1.y);
        assertEquals(3., r1.z);
        final Vector3 r2 = m.row(1);
        assertNotSame(r1, r2); // Vector is not recycled
        assertEquals(4., r2.x);
        assertEquals(5., r2.y);
        assertEquals(6., r2.z);
        final Vector3 r3 = m.row(2);
        assertEquals(7., r3.x);
        assertEquals(8., r3.y);
        assertEquals(9., r3.z);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        assertEquals(9., r3.z);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testRow02() {
        new Matrix3().row(-1);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().row(-1);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testRow03() {
        new Matrix3().row(3);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

    @Test
    public void testColumnVectors() {
        final Vector3 c1 = new Vector3();
        final Vector3 c2 = new Vector3();
        final Vector3 c3 = new Vector3();
        new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.).getColumnVectors(c1, c2, c3);

        assertEquals(1., c1.x);
View Full Code Here

Examples of jinngine.math.Matrix3

        assertEquals(9., c3.z);
    }

    @Test(expected = NullPointerException.class)
    public void testColumnVectors02() {
        new Matrix3().getColumnVectors(null, new Vector3(), new Vector3());
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().getColumnVectors(null, new Vector3(), new Vector3());
    }

    @Test(expected = NullPointerException.class)
    public void testColumnVectors03() {
        new Matrix3().getColumnVectors(new Vector3(), null, new Vector3());
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().getColumnVectors(new Vector3(), null, new Vector3());
    }

    @Test(expected = NullPointerException.class)
    public void testColumnVectors04() {
        new Matrix3().getColumnVectors(new Vector3(), new Vector3(), null);
    }
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.