Examples of distance()


Examples of com.jme.math.Vector3f.distance()

                }
               
                // if we are performing a collision check, see if the
                // camera is closer than the collision
                if (collisionCheck) {
                    if (target.distance(translation) <= details.getDistance()) {
                        // camera is closer than the nearest collision,
                        // re-enable collision
                        collisionEnabled = true;
                    }
                   
View Full Code Here

Examples of com.jme.math.Vector3f.distance()

               
                // if the collision is farther than where the camera would
                // have been positioned or outside of range, we can stop and
                // leave the camera as is
                if (details.getDistance() >= MAX_DISTANCE ||
                    details.getDistance() >= target.distance(translation))
                {
                    break;
                }
               
                // if we made it here, the collision is within range. Move
View Full Code Here

Examples of com.jme3.math.Vector3f.distance()

    }

    // env state - target
    Vector3f targetCoords = getBluePillWorldTranslation();
    Vector3f leftEyeCoords = leftEye.getWorldTranslation();
    float distL = leftEyeCoords.distance(targetCoords) - TARGET_RADIUS;
    Vector3f rightEyeCoords = rightEye.getWorldTranslation();
    float distR = rightEyeCoords.distance(targetCoords) - TARGET_RADIUS;
    Vector3f headCoords = head.getWorldTranslation();
    float headDistance = headCoords.distance(targetCoords) - TARGET_RADIUS - HEAD_RADIUS;
    boolean wasCollision = headDistance < 0.005f;
View Full Code Here

Examples of com.spatial4j.core.distance.DistanceCalculator.distance()

    msg += " ctr:"+center;
    //System.out.println(msg);
    assertRelation(msg, CONTAINS, r, center);

    DistanceCalculator dc = ctx.getDistCalc();
    double dUR = dc.distance(center, r.getMaxX(), r.getMaxY());
    double dLR = dc.distance(center, r.getMaxX(), r.getMinY());
    double dUL = dc.distance(center, r.getMinX(), r.getMaxY());
    double dLL = dc.distance(center, r.getMinX(), r.getMinY());

    assertEquals(msg,width != 0 || height != 0, dUR != 0);
View Full Code Here

Examples of com.vividsolutions.jts.geom.Coordinate.distance()

        /**
         * Compute the largest diameter (length) that will produce a split segment which is not
         * still encroached upon by the encroaching point (The length is reduced slightly by a
         * safety factor)
         */
        double nonEncroachDiam = projPt.distance(encroachPt) * 2 * 0.8; // .99;
        double maxSplitLen = nonEncroachDiam;
        if (maxSplitLen > midPtLen) {
            maxSplitLen = midPtLen;
        }
        splitSeg.setMinimumLength(maxSplitLen);
View Full Code Here

Examples of com.vividsolutions.jts.geom.Geometry.distance()

    }

    static public double distance(Geometry arg0, Geometry arg1) {
        Geometry _this = arg0;

        return _this.distance(arg1);
    }

    static public boolean isWithinDistance(Geometry arg0, Geometry arg1,
            double arg2) {
        Geometry _this = arg0;
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineSegment.distance()

  /**
   * returns the closest distance between point p and line segment s
   */
  public static final double distanceFromLineSegment(VectorXZ p, LineSegmentXZ s) {
    LineSegment sJTS = new LineSegment(s.p1.x, s.p1.z, s.p2.x, s.p2.z);
    return sJTS.distance(new Coordinate(p.x, p.z));
  }

  /**
   * returns a sequence of vectors at a distance above an original sequence
   *
 
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineString.distance()

    LineString firstSegment = gf.createLineString(firstOriginalSegment);
    LineString secondSegment = gf.createLineString(secondOriginalSegment);
    Geometry point = gf.createPoint(imaginaryCoord);

    if (totalIntersection == 2
          && (firstSegment.distance(point) < SMALL_DISTANCE || secondSegment.distance(point) < SMALL_DISTANCE)) {
      return true;
    }
    return false;
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.Point.distance()

              pts.add(pt);
            }
          }
          for (Iterator<Point> itr = pts.iterator(); itr.hasNext();) {
            Point pt = itr.next();
            double d = pt.distance(ptStart);
            if (d < nearestStart) {
              nearestStart = d;
              nearestCrossStart = pt;
            }
          }
View Full Code Here

Examples of com.vividsolutions.jts.linearref.LinearLocation.distance()

        double distance = snap.distance(point.getCoordinate());
        results.add(new PointResult(layer.getGeometryFactory()
            .createPoint(snap), record, distance));
      } else if (geom instanceof Point) {
                Point here = (Point) geom;
                results.add(new PointResult(here,record,here.distance(point)));
            }
    }
    Collections.sort(results);
    return results;
  }
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.