Examples of toSubSpace()


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

    public void testPointAt() {
        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2));
        for (double a = -2.0; a < 2.0; a += 0.2) {
            Vector1D pA = new Vector1D(a);
            Vector2D 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(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

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

            Vector2D 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(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

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

    private boolean checkInSegment(Vector2D p,
                                   Vector2D p1, Vector2D p2,
                                   double tolerance) {
        Line line = new Line(p1, p2);
        if (line.getOffset(p) < tolerance) {
            double x  = (line.toSubSpace(p)).getX();
            double x1 = (line.toSubSpace(p1)).getX();
            double x2 = (line.toSubSpace(p2)).getX();
            return (((x - x1) * (x - x2) <= 0.0)
                    || (p1.distance(p) < tolerance)
                    || (p2.distance(p) < tolerance));
View Full Code Here

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

                                   Vector2D p1, Vector2D p2,
                                   double tolerance) {
        Line line = new Line(p1, p2);
        if (line.getOffset(p) < tolerance) {
            double x  = (line.toSubSpace(p)).getX();
            double x1 = (line.toSubSpace(p1)).getX();
            double x2 = (line.toSubSpace(p2)).getX();
            return (((x - x1) * (x - x2) <= 0.0)
                    || (p1.distance(p) < tolerance)
                    || (p2.distance(p) < tolerance));
        } else {
View Full Code Here

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

                                   double tolerance) {
        Line line = new Line(p1, p2);
        if (line.getOffset(p) < tolerance) {
            double x  = (line.toSubSpace(p)).getX();
            double x1 = (line.toSubSpace(p1)).getX();
            double x2 = (line.toSubSpace(p2)).getX();
            return (((x - x1) * (x - x2) <= 0.0)
                    || (p1.distance(p) < tolerance)
                    || (p2.distance(p) < tolerance));
        } else {
            return false;
View Full Code Here

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));
        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

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

        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

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

                            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

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

                            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

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

    public void testPointAt() {
        Line l = new Line(new Vector2D(2, 1), new Vector2D(-2, -2));
        for (double a = -2.0; a < 2.0; a += 0.2) {
            Vector1D pA = new Vector1D(a);
            Vector2D 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(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
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.