Package jinngine.math

Examples of jinngine.math.Matrix3


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

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


        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

        assertEquals(9., r3.z);
    }

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

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

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

    @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

        assertEquals(9., c3.z);
    }

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

        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

        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

    @Test
    public void testRowVectors() {
        final Vector3 r1 = new Vector3();
        final Vector3 r2 = new Vector3();
        final Vector3 r3 = new Vector3();
        new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.).getRowVectors(r1, r2, r3);
        assertEquals(1., r1.x);
        assertEquals(2., r1.y);
View Full Code Here

        assertEquals(9., r3.z);
    }

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

TOP

Related Classes of jinngine.math.Matrix3

Copyright © 2018 www.massapicom. 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.