Example #1
0
 public double getDirection(Tank that) {
   Coordinate other = that.getLocation();
   return Math.atan2(other.y() - location.y(), other.x() - location.x());
 }
Example #2
0
 public double getDistance(Tank that) {
   Coordinate other = that.getLocation();
   return Math.sqrt(Math.pow(other.x() - location.x(), 2) + Math.pow(other.x() - location.y(), 2));
 }