Shapes

Dot

class pynsn.Dot(xy, diameter, attribute=None)
distance(other)

Return Euclidean distance to the dot d. The function takes the diameter of the points into account.

Parameters

other (Dot) –

Returns

distance

Return type

float

get_attribute_object()

Class instance of the attribute, if possible

Returns

rtn – If attribute represents Colour or PictureFile it returns the instance of the respective class otherwise the previously defined attribute

Return type

attribute

property polar

polar coordinate (radius, pos_angle)

Rectangle

class pynsn.Rectangle(xy, size, attribute=None)
distance(other)

Return Euclidean distance to the dot d. The function takes the size of the rectangles into account.

Parameters

other (Rectangle) –

Returns

distance

Return type

float

get_attribute_object()

Class instance of the attribute, if possible

Returns

rtn – If attribute represents Colour or PictureFile it returns the instance of the respective class otherwise the previously defined attribute

Return type

attribute

iter_edges(xy_tuple=False)

iterator over all four edges

Return type

iterator over Coordinates or tuple (x,y)

xy_distances(other)

return distances on both axes between rectangles. 0 indicates overlap off edges along that dimension.

property polar

polar coordinate (radius, pos_angle)

property proportion

Proportion of the rectangle (width/height)

Point

class pynsn.Point(xy, attribute=None)
distance(other)

Returns Euclidean distance to the another Coordinate. The function does not takes the size of an object into account.

Parameters

other (Coordinate) –

Returns

distance

Return type

float

get_attribute_object()

Class instance of the attribute, if possible

Returns

rtn – If attribute represents Colour or PictureFile it returns the instance of the respective class otherwise the previously defined attribute

Return type

attribute

property polar

polar coordinate (radius, pos_angle)