callable
: something that can be called with params; like a function, method, procedure, macro...Point:
: 2d tuple/list/array or object/struct with coordinates (x, y) as attributes/fieldsRegion
: a callable that receive a point and returntrue
if is inside of a a region, andfalse
if is out.Distance
: a float
- We have a two tanks (in a two positions), and we want to know if we can shot to another positions without danger.
- The tanks have a secure region defined by a circle
- The tanks have a maximun shot distance.
-
Implement a callable named
circle
that receive a float that represent the radius and return aRegion
of a circle centered on the origin of coordinates with this radius. -
Implement operations
shift
,difference
,circle
, anddifference
forRegions
. -
Implement a callable named
target
based on the above operations that return theRegion
wich is the response of the problem. -
target
will receive 3 params:Distance
max_distance: max range of shot.Distance
min_distance: radius of secure region.Position
friend: coordinates of the friend's tank.