Example #1
0
  public PolygonObstacle getRobot() {
    Point2D.Double center = polymap.getRobotStart();
    PolygonObstacle robot = new PolygonObstacle();

    double x, y, angle;
    for (int i = 0; i < NUM_SIDES; i++) {
      angle = i * 2.0 * Math.PI / NUM_SIDES;
      x = RADIUS * Math.cos(angle);
      y = RADIUS * Math.sin(angle);
      robot.addVertex(x, y);
    }

    robot.close();

    return robot;
  }