Package schrodinger :: Package application :: Package matsci :: Package nano :: Module tube :: Class Rectangle
[hide private]
[frames] | no frames]

Class Rectangle

object --+
         |
        Rectangle

Manage the properties of a rectangle.

Instance Methods [hide private]
 
__init__(self, origin, bottom, left, end)
Create an instance.
float
linear_equation(self, ixy, fxy, x)
Return y = m*x + b for m and b from the line formed by initial point ixy and final point fxy.
bool, bool
insideRectangle(self, xy, logger=None)
Return boolean specifying if the provided plane coordinates lie within the boundary.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  INSIDETHRESH = 1e-05
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, origin, bottom, left, end)
(Constructor)

 

Create an instance.

Parameters:
  • origin (numpy.array) - lower left point
  • bottom (numpy.array) - lower right point
  • left (numpy.array) - upper left point
  • end (numpy.array) - upper right point
Overrides: object.__init__

linear_equation(self, ixy, fxy, x)

 

Return y = m*x + b for m and b from the line formed by initial point ixy and final point fxy.

Parameters:
  • ixy (numpy.array) - initial point on line
  • fxy (numpy.array) - final point on line
  • x (float) - domain argument
Returns: float
y, range value

insideRectangle(self, xy, logger=None)

 

Return boolean specifying if the provided plane coordinates lie within the boundary.

Parameters:
  • xy (numpy.array) - plane coordinates
  • logger (logging.getLogger) - output logger
Returns: bool, bool
insidex, insidey, inside the x-boundary or not, same for y-boundary