Package org.apache.commons.math3.geometry.euclidean.twod

Examples of org.apache.commons.math3.geometry.euclidean.twod.Line.toSubSpace()


    @Test
    public void testAbscissa() {
        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2), 1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D(-34))).getX(),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
View Full Code Here


        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2), 1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D(-34))).getX(),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
View Full Code Here

                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
                             (l.toSubSpace(new Vector2D(-1, -7))).getX(),
                             1.0e-10);
    }
View Full Code Here

                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
                             (l.toSubSpace(new Vector2D(-1, -7))).getX(),
                             1.0e-10);
    }

    @Test
    public void testOffset() {
View Full Code Here

    public void testPointAt() {
        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2), 1.0e-10);
        for (double a = -2.0; a < 2.0; a += 0.2) {
            Point<Euclidean1D> pA = new Vector1D(a);
            Point<Euclidean2D> point = l.toSpace(pA);
            Assert.assertEquals(a, (l.toSubSpace(point)).getX(), 1.0e-10);
            Assert.assertEquals(0.0, l.getOffset(point),   1.0e-10);
            for (double o = -2.0; o < 2.0; o += 0.2) {
                point = l.getPointAt((Vector1D) pA, o);
                Assert.assertEquals(a, (l.toSubSpace(point)).getX(), 1.0e-10);
                Assert.assertEquals(o, l.getOffset(point),   1.0e-10);
View Full Code Here

            Point<Euclidean2D> point = l.toSpace(pA);
            Assert.assertEquals(a, (l.toSubSpace(point)).getX(), 1.0e-10);
            Assert.assertEquals(0.0, l.getOffset(point),   1.0e-10);
            for (double o = -2.0; o < 2.0; o += 0.2) {
                point = l.getPointAt((Vector1D) pA, o);
                Assert.assertEquals(a, (l.toSubSpace(point)).getX(), 1.0e-10);
                Assert.assertEquals(o, l.getOffset(point),   1.0e-10);
            }
        }
    }
View Full Code Here

    @Test
    public void testAbscissa() {
        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2));
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D(-34))).getX(),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
View Full Code Here

        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2));
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D(-34))).getX(),
                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
View Full Code Here

                            1.0e-10);
        Assert.assertEquals(0.0,
                            (l.toSubSpace(new Vector2D( 3, -4))).getX(),
                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
                             (l.toSubSpace(new Vector2D(-1, -7))).getX(),
                             1.0e-10);
    }
View Full Code Here

                            1.0e-10);
        Assert.assertEquals(-5.0,
                            (l.toSubSpace(new Vector2D( 7, -1))).getX(),
                            1.0e-10);
        Assert.assertEquals( 5.0,
                             (l.toSubSpace(new Vector2D(-1, -7))).getX(),
                             1.0e-10);
    }

    @Test
    public void testOffset() {
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.