Package java.awt

Examples of java.awt.Point.distance()


                while(scan.hasNext()){
                    second = first;
                    first = new Point(scan.nextInt(), scan.nextInt());

                    while((first.distance(second) < MoveController.discretisation) && scan.hasNext())
                        first.setLocation(scan.nextInt(), scan.nextInt());

                    MoveController.trajectoryPoints.elementAt(id).add(first);
                }
View Full Code Here


  public float estimateCostToGoal(int state) {
    Point current;
    for (Vertex v : vertexList) {
      if (v.id == state) {
        current = v.position;
        return (float) current.distance(goal.position);
      }
    }
    return Float.POSITIVE_INFINITY;
  }
}
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
View Full Code Here

        Arrays.fill(data, 0);
        for (int i = 0; i < 4; i++) {
            Point p = state.transformPoint(pa[i], ctm);

            int length = (int) p.distance(0, 0);
            if (p.x == 0 && p.y > 0) {
                data[UP] = length;
            } else if (p.x == 0 && p.y < 0) {
                data[DOWN] = length;
            } else if (p.x > 0 && p.y == 0) {
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
View Full Code Here

    if (isTargetVisible()) {
      endPoint = target.getLinkPoint(connectorModel.getEndInclination());
      targetIsLeft = target.isLeft();
    }
    if (connectorModel.getEndInclination() == null || connectorModel.getStartInclination() == null) {
      final int dellength = isSourceVisible() && isTargetVisible() ? Math.max(40, (int)(startPoint.distance(endPoint) / getZoom())) : 40;
      if (isSourceVisible() && connectorModel.getStartInclination() == null) {
        final Point incl = calcInclination(source, dellength);
        connectorModel.setStartInclination(incl);
        startPoint = source.getLinkPoint(connectorModel.getStartInclination());
      }
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
View Full Code Here

      // Determine if there is too much overlap with other animals
      final double tooClose = new Point(width, height).distance(new Point(0, 0)) / 2.0;
      boolean tooMuchOverlap = false;
      for (final PlacedAnimal animal : animals)
      {
        if (point.distance(animal.location) < tooClose)
        {
          tooMuchOverlap = true;
          break;
        }
      }
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.