Examples of distance()


Examples of org.bukkit.Location.distance()

      } else {
        //Subtract whole block distances (switch to next guideline)
        while (true) {
          double tmpnext = Double.MAX_VALUE;
          if (guideindex < guide.length - 1) {
            tmpnext = prev.distance(guide[guideindex]);
          }
          if (tmpnext <= towalk) {
            towalk -= tmpnext;
            prev = guide[guideindex];
            guideindex++;
View Full Code Here

Examples of org.bukkit.util.BlockVector.distance()

        for (int i = -1; i < 4; i++) {
            Vector center = new BlockVector(rx, ry - i, rz);
            for (int x = -radius; x <= radius; x++) {
                for (int z = -radius; z <= radius; z++) {
                    Vector position = center.clone().add(new Vector(x, 0, z));
                    if (center.distance(position) <= radius + 0.5 - i) {
                        lakeBlocks.add(world.getBlockAt(position.toLocation(world)));
                    }
                }
            }
        }
View Full Code Here

Examples of org.codemap.util.geom.Point2D.distance()

      }
     
      // 3. get adjacent point of closestLine and heightLine, to compute b1
      Point2D b1Point = areLinesAdjacent(closestLine, heightLine);
      assert (b1Point != null);
      double b1 = b1Point.distance(closest);
     
      // 4. get adjacent point of furthestLine and heightLine, to compute b2
      Point2D b2Point = areLinesAdjacent(furthestLine, heightLine);
      assert(b2Point != null);
      double b2 = b2Point.distance(furthest);
View Full Code Here

Examples of org.elasticsearch.index.search.geo.GeoDistanceFilter.distance()

        DeletionAwareConstantScoreQuery constantScoreQuery = (DeletionAwareConstantScoreQuery) parsedQuery.query();
        GeoDistanceFilter filter = (GeoDistanceFilter) constantScoreQuery.getFilter();
        assertThat(filter.fieldName(), equalTo("location"));
        assertThat(filter.lat(), closeTo(40, 0.00001));
        assertThat(filter.lon(), closeTo(-70, 0.00001));
        assertThat(filter.distance(), closeTo(12, 0.00001));
    }

    @Test public void testGeoDistanceFilter1() throws IOException {
        IndexQueryParserService queryParser = queryParser();
        String query = copyToStringFromClasspath("/org/elasticsearch/index/query/geo_distance1.json");
View Full Code Here

Examples of org.encog.ml.hmm.alog.KullbackLeiblerDistanceCalculator.distance()

  public void validate(HiddenMarkovModel result, HiddenMarkovModel source)
  {
    KullbackLeiblerDistanceCalculator klc =
        new KullbackLeiblerDistanceCalculator();
         
      double e = klc.distance(result, source);
      Assert.assertTrue(e<0.01);
  }
 
  public void testDiscPersistEG()
  {
View Full Code Here

Examples of org.geomajas.gwt.client.spatial.LineSegment.distance()

    double currThreshold = threshold;

    for (Coordinate[] coordinateArray : coordinates) {
      for (int j = 1; j < coordinateArray.length; j++) {
        LineSegment line = new LineSegment(coordinateArray[j], coordinateArray[j - 1]);
        double distance = line.distance(original);
        if (distance < currThreshold && distance < ruleDistance) {
          currThreshold = distance;
          minimumDistance = distance;
          snappingPoint = line.nearest(original);
        }
View Full Code Here

Examples of org.geotools.geometry.DirectPosition2D.distance()

        DirectPosition2D center = new DirectPosition2D(crs,
                (x2 / 2) - (t * y2) + p0.getCoordinate()[0],
                (y2 / 2) + (t * x2) + p0.getCoordinate()[1]);

        return new Circle(center.getDirectPosition(),
            center.distance(new DirectPosition2D(p0)));
    }

    /**
     * Returns the three triangles that are created by splitting this
     * TINTriangle at a newVertex.
View Full Code Here

Examples of org.geotools.geometry.iso.primitive.CurveImpl.distance()

              LineSegmentImpl seg = new LineSegmentImpl(p1, p2, 0);
              //(LineSegmentImpl)cf.createLineSegment(cf.createPosition(this.forParam(actualParam)),cf.createPosition(this.forParam(actualParam+newSpacing)));

              /* Search maximum of all distances */
              CurveImpl curve = new CurveImpl(seg);
              maxDistance = curve.distance( new PointImpl(segments.get(firstSegment).getStartPoint()) );
              //maxDistance = seg.distance(segments.get(firstSegment).getStartPoint());
              double actDistance = 0;
              for (i=firstSegment; i<lastSegment; i++) {
                actDistance = curve.distance( new PointImpl(segments.get(i).getEndPoint()) );
                //actDistance = seg.distance(segments.get(i).getEndPoint());
View Full Code Here

Examples of org.jmol.modelset.Atom.distance()

            break;
          case Token.distance:
            if (planeRef != null)
              fv = Measure.distanceToPlane(planeRef, atom);
            else
              fv = atom.distance(ptRef);
            break;
          default:
            fv = Atom.atomPropertyFloat(viewer, atom, tok);
          }
          if (fv == Float.MAX_VALUE || Float.isNaN(fv)
View Full Code Here

Examples of org.newdawn.slick.geom.Vector2f.distance()

    return getDistance(new Vector2f(other.x, other.y));
  }

  public float getDistance(Vector2f otherPos) {
    Vector2f myPos = new Vector2f(x, y);
    return myPos.distance(otherPos);
  }

  public static Vector2f calculateVector(float angle, float magnitude) {
    Vector2f v = new Vector2f();
    v.x = (float) Math.sin(Math.toRadians(angle));
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.