Package java.awt

Examples of java.awt.Point.distance()


        OffsetIterator it = new OffsetIterator(way.getNodes(), offset);
        while (it.hasNext()) {
            Point thisP = it.next();

            if (lastP != null) {
                final double segmentLength = thisP.distance(lastP);

                final double dx = thisP.x - lastP.x;
                final double dy = thisP.y - lastP.y;

                // pos is the position from the beginning of the current segment
View Full Code Here


      // find if there is a matched part in the expected location
      // according to this hypothesis
     
      for (RegionMatch s2 : tms2){     
        Point seenLocation = s2.getLocation();
        boolean isMatchedPartSeenNearbyExpectedLocation = seenLocation.distance(expectedLocation.x,expectedLocation.y) < 5.0f;
        if (isMatchedPartSeenNearbyExpectedLocation){         
          h1.setTopRight(new ModelPartMatch(model.getTopRight(),s2));         
          break;
        }
      }
View Full Code Here

     
      expectedLocation = h1.getExpectedBottomLeftPartModelLocation();
       
      for (RegionMatch s4 : tms4){
        Point seenLocation = s4.getLocation();
        boolean isMatchedPartSeenNearbyExpectedLocation = seenLocation.distance(expectedLocation.x, expectedLocation.y) < 5.0f;
        if (isMatchedPartSeenNearbyExpectedLocation){         
          h1.setBottomLeft(new ModelPartMatch(model.getBottomLeft(),s4));         
          break;
        }
      }
View Full Code Here

     */
    public double getMeterPerPixel() {
        Point origin = new Point(5, 5);
        Point center = new Point(getWidth() / 2, getHeight() / 2);

        double pDistance = center.distance(origin);

        Coordinate originCoord = getPosition(origin);
        Coordinate centerCoord = getPosition(center);

        double mDistance = tileSource.getDistance(originCoord.getLat(), originCoord.getLon(),
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.