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

Examples of org.apache.commons.math3.geometry.euclidean.threed.SphereGenerator


        Assert.assertTrue(ball.getRadius() < 0);
    }

    @Test
    public void testNoPoints() {
        SphereGenerator generator = new SphereGenerator();
        WelzlEncloser<Euclidean3D, Vector3D> encloser =
                new WelzlEncloser<Euclidean3D, Vector3D>(1.0e-10, generator);
        EnclosingBall<Euclidean3D, Vector3D> ball = encloser.enclose(new ArrayList<Vector3D>());
        Assert.assertTrue(ball.getRadius() < 0);
    }
View Full Code Here


                              new Vector3D(-7.141675762759172, -16.57285247140702811.714033471449508),
                              new Vector3D(-7.140453077221105, -16.57021282078064711.708624578004980),
                              new Vector3D(-7.140322188726825, -16.57415289455771711.710305611121410),
                              new Vector3D(-7.141116131477088, -16.57406116462456011.712938509321699));
        WelzlEncloser<Euclidean3D, Vector3D> encloser =
                new WelzlEncloser<Euclidean3D, Vector3D>(1.0e-10, new SphereGenerator());
        EnclosingBall<Euclidean3D, Vector3D> ball = encloser.enclose(list);
        Assert.assertTrue(ball.getRadius() > 0);
    }
View Full Code Here

                              new Vector3D( -0.04543996608267075,  -1.9308185392379775014.79497997883171400),
                              new Vector3D( -1.53348892951571640,  -3.6668891970352490014.73095600812074200),
                              new Vector3D( -0.98034899533935820,  -3.3400448116276396013.03245014017556800));

        WelzlEncloser<Euclidean3D, Vector3D> encloser =
                new WelzlEncloser<Euclidean3D, Vector3D>(1.0e-10, new SphereGenerator());
        EnclosingBall<Euclidean3D, Vector3D> ball = encloser.enclose(list);
        Assert.assertTrue(ball.getRadius() > 0);
    }
View Full Code Here

                if (count++ != i) {
                    reducedSupport.add(s);
                }
            }
            EnclosingBall<Euclidean3D, Vector3D> reducedSphere =
                    new SphereGenerator().ballOnSupport(reducedSupport);
            boolean foundOutside = false;
            for (int j = 0; j < points.size() && !foundOutside; ++j) {
                if (!reducedSphere.contains(points.get(j), 1.0e-10)) {
                    foundOutside = true;
                }
View Full Code Here

    }

    private EnclosingBall<Euclidean3D, Vector3D> checkSphere(List<Vector3D> points) {

        WelzlEncloser<Euclidean3D, Vector3D> encloser =
                new WelzlEncloser<Euclidean3D, Vector3D>(1.0e-10, new SphereGenerator());
        EnclosingBall<Euclidean3D, Vector3D> Sphere = encloser.enclose(points);

        // all points are enclosed
        for (Vector3D v : points) {
            Assert.assertTrue(Sphere.contains(v, 1.0e-10));
View Full Code Here

                points.add(v.getLocation().getVector());
            }
        }

        // find the smallest enclosing 3D sphere
        final SphereGenerator generator = new SphereGenerator();
        final WelzlEncloser<Euclidean3D, Vector3D> encloser =
                new WelzlEncloser<Euclidean3D, Vector3D>(getTolerance(), generator);
        EnclosingBall<Euclidean3D, Vector3D> enclosing3D = encloser.enclose(points);
        final Vector3D[] support3D = enclosing3D.getSupport();
View Full Code Here

     
      List<SiteWithPolynomial> nearestSites =
          nearestSiteMap.get(site);
     
      RealVector vector = new ArrayRealVector(SITES_FOR_APPROX);
      RealMatrix matrix = new Array2DRowRealMatrix(
          SITES_FOR_APPROX, DefaultPolynomial.NUM_COEFFS);
     
      for (int row = 0; row < SITES_FOR_APPROX; row++) {
        SiteWithPolynomial nearSite = nearestSites.get(row);
        DefaultPolynomial.populateMatrix(matrix, row, nearSite.pos.x, nearSite.pos.z);
View Full Code Here

        }

        // solve the rectangular system in the least square sense
        // to get the best estimate of the Nordsieck vector [s2 ... sk]
        QRDecomposition decomposition;
        decomposition = new QRDecomposition(new Array2DRowRealMatrix(a, false));
        RealMatrix x = decomposition.getSolver().solve(new Array2DRowRealMatrix(b, false));
        return new Array2DRowRealMatrix(x.getData(), false);
    }
View Full Code Here

            // update Nordsieck vector
            final double[] predictedScaled = new double[y0.length];
            for (int j = 0; j < y0.length; ++j) {
                predictedScaled[j] = stepSize * yDot[j];
            }
            final Array2DRowRealMatrix nordsieckTmp = updateHighOrderDerivativesPhase1(nordsieck);
            updateHighOrderDerivativesPhase2(scaled, predictedScaled, nordsieckTmp);
            interpolator.reinitialize(stepEnd, stepSize, predictedScaled, nordsieckTmp);

            // discrete events handling
            interpolator.storeTime(stepEnd);
View Full Code Here

     * @param residuals Residuals.
     * @return the cost.
     * @see #computeResiduals(double[])
     */
    protected double computeCost(double[] residuals) {
        final ArrayRealVector r = new ArrayRealVector(residuals);
        return FastMath.sqrt(r.dotProduct(getWeight().operate(r)));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.geometry.euclidean.threed.SphereGenerator

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.