Package jinngine.math

Examples of jinngine.math.Matrix3


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

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


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

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

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

    @Test
    public void testMultiplyDouble() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 r = m.multiply(2);
        assertNotSame(r, m);
        assertMatrixEquals(new double[]{
                    1., 2., 3.,
                    4., 5., 6.,
                    7., 8., 9.}, m);
View Full Code Here

    }

    @Test
    public void testScaleVector() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Vector3 s = new Vector3(2., 3., 4.);
        final Matrix3 r = m.scale(s);
        assertNotSame(r, m);
        //Vector unmodified
        assertEquals(2., s.x);
        assertEquals(3., s.y);
        assertEquals(4., s.z);
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testScaleVector02() {
        new Matrix3().scale(null);
    }
View Full Code Here

        new Matrix3().scale(null);
    }

    @Test
    public void testMultiply01() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 n = new Matrix3(10., 11., 12.,
                13., 14., 15.,
                16., 17., 18.);
        final Matrix3 r = m.multiply(n);
        assertNotSame(m, r); // R is new
        assertNotSame(n, r); // R is new

        //Input is not changed
        assertMatrixEquals(new double[]{
View Full Code Here

                    318., 342., 366.}, r);
    }

    @Test(expected = NullPointerException.class)
    public void testMultiply02() {
        new Matrix3().multiply((Matrix3) null);
    }
View Full Code Here

        new Matrix3().multiply((Matrix3) null);
    }

    @Test
    public void testAssignMultiply01() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 n = new Matrix3(10., 11., 12.,
                13., 14., 15.,
                16., 17., 18.);
        final Matrix3 r = m.assignMultiply(n);
        assertSame(m, r); // r is m
        assertNotSame(n, r); // R is new       
        //Input is not changed
        assertMatrixEquals(new double[]{
                    10., 11., 12.,
View Full Code Here

                    318., 342., 366.}, r);
    }

    @Test(expected = NullPointerException.class)
    public void testAssignMultiply02() {
        new Matrix3().assignMultiply((Matrix3) null);
    }
View Full Code Here

        new Matrix3().assignMultiply((Matrix3) null);
    }

    @Test
    public void testMultiplyVector01() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Vector3 v = new Vector3(10., 100., 1000.);
        final Vector3 r = m.multiply(v);
        assertNotSame(r, v);//new Vector3 is returned
        //Input is not changed
        assertMatrixEquals(new double[]{
                    1., 2., 3.,
                    4., 5., 6.,
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.