pysal.lib.cg.Rectangle

class pysal.lib.cg.Rectangle(left, lower, right, upper)[source]

Geometric representation of rectangle objects.

Attributes:
left : float

Minimum x-value of the rectangle

lower : float

Minimum y-value of the rectangle

right : float

Maximum x-value of the rectangle

upper : float

Maximum y-value of the rectangle

Methods

set_centroid(new_center) Moves the rectangle center to a new specified point.
set_scale(scale) Rescales the rectangle around its center.
__init__(left, lower, right, upper)[source]

Returns a Rectangle object.

__init__(number, number, number, number) -> Rectangle

Parameters:
left : the minimum x-value of the rectangle
lower : the minimum y-value of the rectangle
right : the maximum x-value of the rectangle
upper : the maximum y-value of the rectangle

Examples

>>> r = Rectangle(-4, 3, 10, 17)
>>> r.left #minx
-4.0
>>> r.lower #miny
3.0
>>> r.right #maxx
10.0
>>> r.upper #maxy
17.0

Methods

__init__(left, lower, right, upper) Returns a Rectangle object.
set_centroid(new_center) Moves the rectangle center to a new specified point.
set_scale(scale) Rescales the rectangle around its center.

Attributes

area Returns the area of the Rectangle.
height Returns the height of the Rectangle.
width Returns the width of the Rectangle.