expyriment.misc.geometry.XYPoint¶
-
class
expyriment.misc.geometry.
XYPoint
(x=None, y=None, xy=None)[source]¶ The Expyriment point class
Methods
-
__init__
(x=None, y=None, xy=None)[source]¶ Initialize a XYPoint.
Parameters: x : numeric
y : numeric
xy : (numeric, numeric)
xy = (x,y)
Notes
use x, y values (two numberic) or the tuple xy=(x,y)
-
distance
(p)[source]¶ Return euclidian distance to the points (p).
Parameters: p : misc.XYPoint
movement vector
Returns: dist : float
distance to other point p
-
is_inside_polygon
(point_list)[source]¶ Return true if point is inside a given polygon.
Parameters: point_list : list
point list defining the polygon
Returns: check : bool
-
move
(v)[source]¶ Move the point along the coodinates specified by the vector v.
Parameters: v : misc.XYPoint
movement vector
-
rotate
(degree, rotation_centre=(0, 0))[source]¶ Rotate the point counterclockwise in degree around rotation_centre.
Parameters: degree : int
degree of rotation (default=(0, 0) )
rotation_center : (numeric, numeric)
rotation center (x, y)
-
x
¶ Getter for x
-
y
¶ Getter for y
-