Package horizons :: Package util :: Package shapes :: Module circle :: Class Circle
[hide private]
[frames] | no frames]

Class Circle

source code

Shape --+
        |
       Circle

Class for the shape of a circle You can access center and radius of the circle as public members.

Instance Methods [hide private]
 
__init__(self, center, radius) source code
 
contains(self, point) source code
 
intersects_rect(self, rect) source code
 
__str__(self) source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__hash__(self) source code
 
tuple_iter(self)
Iterate through all coords in the circle as tuples.
source code
 
get_border_coordinates(self, bordersize=1)
Returns only coordinates at the border.
source code
    Inherited from Shape
 
__iter__(self)
Return all coordinates in the shape as points.
source code
 
distance(self, other) source code
 
get_coordinates(self)
Return all coordinates in the shape.
source code
 
get_distance_function(self, other) source code
Method Details [hide private]

__init__(self, center, radius)
(Constructor)

source code 
Parameters:
  • center - Point
  • radius - int

tuple_iter(self)

source code 

Iterate through all coords in the circle as tuples.

Overrides: Shape.tuple_iter

get_border_coordinates(self, bordersize=1)

source code 

Returns only coordinates at the border. Very naive implementation