Examples of distance()


Examples of org.openstreetmap.josm.data.coor.EastNorth.distance()

            for (Pair<Node, Node> chunk : streetPart.getNodePairs(false)) {
                EastNorth p1 = chunk.a.getEastNorth();
                EastNorth p2 = chunk.b.getEastNorth();
                if (p1 != null && p2 != null) {
                    EastNorth closest = Geometry.closestPointToSegment(p1, p2, centroid);
                    if (closest.distance(centroid) <= maxDistance) {
                        return;
                    }
                } else {
                    Main.warn("Addresses test skipped chunck "+chunk+" for street part "+streetPart+" because p1 or p2 is null");
                }
View Full Code Here

Examples of org.opentripplanner.common.geometry.DistanceLibrary.distance()

        DistanceLibrary distanceLibrary = SphericalDistanceLibrary.getInstance();
        Coordinate fromc = fromv.getCoordinate();
        Coordinate toc = tov.getCoordinate();
        geometry = GeometryUtils.getGeometryFactory().createLineString(
                new Coordinate[] { fromc, toc });
        linkDistance = distanceLibrary.distance(fromc, toc);
    }

    @Override
    public String getName() {
        // TODO I18n
View Full Code Here

Examples of org.owasp.passfault.dictionary.LevenshteinDistance.distance()

    LevenshteinDistance ld = new LevenshteinDistance(s);

    for (int i = 0, len = t.length(); i < len; i++) {
      ld.appendToTarget(t.charAt(i));
      actualValue = ld.updateDist();
      System.out.println("add char: " + t.charAt(i) + " dist = " + actualValue + "(" + ld.distance()
          + "), relativeDistance = " + ld.partialDistance());
    }
    actualValue = ld.distance();
    return actualValue;
  }
View Full Code Here

Examples of org.spout.api.geo.discrete.Point.distance()

      Point pos = point.add(direction.mul(d));
      Entity near = point.getWorld().getNearestEntity(pos, player, (int) lastDistanceToEntity);
      if (near == null) {
        continue;
      }
      double distance = pos.distance(near.getPhysics().getPosition());
      if (distance < lastDistanceToEntity) {
        lastDistanceToEntity = distance;
        nearest = near;
        if (distance < 0.5) {
          break;
View Full Code Here

Examples of pythagoras.f.Point.distance()

        }
        // if not, maybe impart some velocity
        float dragTime = (float)(_curStamp - _prevStamp);
        Point delta = new Point(_cur.x - _prev.x, _cur.y - _prev.y);
        Point dragVel = delta.mult(1 / dragTime);
        float dragSpeed = dragVel.distance(0, 0);
        if (dragSpeed > flickSpeedThresh() && delta.distance(0, 0) > minFlickDelta()) {
            if (dragSpeed > maxFlickSpeed()) {
                dragVel.multLocal(maxFlickSpeed() / dragSpeed);
                dragSpeed = maxFlickSpeed();
            }
View Full Code Here

Examples of soc.qase.state.Origin.distance()

    float distance = Float.MAX_VALUE;

    for(int i = 0; i < filteredEntities.size(); i++)
    {
      tempEntity = (Entity)filteredEntities.elementAt(i);
      tempDistance = currentPos.distance(tempEntity.getOrigin());

      if(tempDistance < distance && tempDistance > 0)
      {
        distance = tempDistance;
        nearestEntity = tempEntity;
View Full Code Here

Examples of soc.qase.tools.vecmath.Vector3f.distance()

        for(int i = 0; i < deactEnts.length; i++)
        {
          deactEnts[i].setConfig(config);
          entOrigin.set(deactEnts[i].getOrigin());

          if(deactEnts[i].getNumber() != playerEntityNum + 1 && deactEnts[i].getNumber() > 0 && (curDist = playerOrigin.distance(entOrigin)) < minDist && deactEnts[i].getInventoryIndex() == pkup)
          {
            minDist = curDist;
            index = deactEnts[i].getNumber();
          }
        }
View Full Code Here

Examples of stallone.coordinates.MinimalRMSDistance3D.distance()

            MinimalRMSDistance3D minrmsd = new MinimalRMSDistance3D(Xref.rows());

            @Override
            public void transform(IDoubleArray in, IDoubleArray out)
            {
                out.set(0, minrmsd.distance(Xref, in));
            }
        };
    }

    public ICoordinateTransform transform_distances(final int[] set1)
View Full Code Here

Examples of tv.floe.metronome.clustering.kmeans.DistanceMeasurer.distance()

    double [] d2 = {3,4};
    Point p1 = new Point(d1);
    Point p2 = new Point(d2);
   
    DistanceMeasurer measurer = new DistanceMeasurer();
    assertEquals(5.0, measurer.distance(p1, p2), 0.0000000001);
    assertEquals(5.0, measurer.distance(p2, p1), 0.0000000001);
  }

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