expyriment.misc.geometry

The geometry module.

This module contains miscellaneous geometry functions for expyriment.

Attributes

Modules

Functions

expyriment.misc.geometry.coordinates2position(coordinate)

Convert a coordinate on the screen to an expyriment position.

Parameters:

coordinate : (int, int)

coordinate (x,y) to convert

Returns:

coordinate : (int, int)

expyriment.misc.geometry.lines_intersect(pa, pb, pc, pd)

Return true if two line segments are intersecting

Parameters:

pa : misc.XYPoint

point 1 of line 1

pb : misc.XYPoint

point 2 of line 1

pc : misc.XYPoint

point 1 of line 2

pb : misc.XYPoint

point 2 of line 2

Returns:

check : bool

True if lines intersect

expyriment.misc.geometry.points_to_vertices(points)

Returns vertex representation of the points (int, int) in xy-coordinates

Parameters:

points : (int, int)

list of points

Returns:

vtx : list

list of vertices

expyriment.misc.geometry.position2coordinate(position)

Convert an expyriment position to a coordinate on screen.

Parameters:

coordinate : (int, int)

coordinate (x,y) to convert

Returns:

coordinate : (int, int)

expyriment.misc.geometry.position2visual_angle(position, viewing_distance, monitor_size)

Convert an expyriment position (pixel) to a visual angle from center.

Parameters:

position : (int, int)

position (x,y) to convert

viewing_distance : numeric

viewing distance in cm

monitior_size : numeric

physical size of the monitor in cm (x, y)

Returns:

angle : (float, float)

visual angle for x & y dimension

expyriment.misc.geometry.visual_angle2position(visual_angle, viewing_distance, monitor_size)

Convert an position defined as visual angle from center to expyriment position (pixel).

Parameters:

visual_angle : (numeric, numeric)

position in visual angle (x,y) to convert

viewing_distance : numeric

viewing distance in cm

monitior_size : (numeric, numeric)

physical size of the monitor in cm (x, y)

Returns:

position : (float, float)

position (x,y)