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

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


        final double tolerance = getTolerance();

        if (hull.size() == 1) {
            // ensure that we do not add an identical point
            final Vector2D p1 = hull.get(0);
            if (p1.distance(point) < tolerance) {
                return;
            }
        }

        while (hull.size() >= 2) {
View Full Code Here


            final double offset = new Line(p1, p2, tolerance).getOffset(point);
            if (FastMath.abs(offset) < tolerance) {
                // the point is collinear to the line (p1, p2)

                final double distanceToCurrent = p1.distance(point);
                if (distanceToCurrent < tolerance || p2.distance(point) < tolerance) {
                    // the point is assumed to be identical to either p1 or p2
                    return;
                }

                final double distanceToLast = p1.distance(p2);
View Full Code Here

                    // Jacobian of the radius residuals.
                    double[][] jacobian = new double[n][2];
                    for (int i = 0; i < n; i++) {
                        final Vector2D pi = points.get(i);
                        final double di = pi.distance(center);
                        jacobian[i][0] = (center.getX() - pi.getX()) / di - dRdX;
                        jacobian[i][1] = (center.getY() - pi.getY()) / di - dRdY;
                    }

                    return jacobian;
View Full Code Here

        final double tolerance = getTolerance();

        if (hull.size() == 1) {
            // ensure that we do not add an identical point
            final Vector2D p1 = hull.get(0);
            if (p1.distance(point) < tolerance) {
                return;
            }
        }

        while (hull.size() >= 2) {
View Full Code Here

            final double offset = new Line(p1, p2, tolerance).getOffset(point);
            if (FastMath.abs(offset) < tolerance) {
                // the point is collinear to the line (p1, p2)

                final double distanceToCurrent = p1.distance(point);
                if (distanceToCurrent < tolerance || p2.distance(point) < tolerance) {
                    // the point is assumed to be identical to either p1 or p2
                    return;
                }

                final double distanceToLast = p1.distance(p2);
View Full Code Here

                // Jacobian of the radius residuals.
                double[][] jacobian = new double[n][2];
                for (int i = 0; i < n; i++) {
                    final Vector2D pi = points.get(i);
                    final double di = pi.distance(center);
                    jacobian[i][0] = (center.getX() - pi.getX()) / di - dRdX;
                    jacobian[i][1] = (center.getY() - pi.getY()) / di - dRdY;
                }

                return jacobian;
View Full Code Here

                    // Jacobian of the radius residuals.
                    double[][] jacobian = new double[n][2];
                    for (int i = 0; i < n; i++) {
                        final Vector2D pi = points.get(i);
                        final double di = pi.distance(center);
                        jacobian[i][0] = (center.getX() - pi.getX()) / di - dRdX;
                        jacobian[i][1] = (center.getY() - pi.getY()) / di - dRdY;
                    }

                    return jacobian;
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.