pymovements.events.disposition#

pymovements.events.disposition(*, position_column: str = 'position', n_components: int = 2) Expr#

Disposition of an event.

The disposition is calculated as:

\[\text{Disposition} = \sqrt{(x_0 - x_n)^2 + (y_0 - y_n)^2}\]

where \(x_0\) and \(y_0\) are the coordinates of the starting position and \(x_n\) and \(y_n\) are the coordinates of the ending position of an event.

Parameters:
  • position_column (str) – The column name of the position tuples. (default: ‘position’)

  • n_components (int) – Number of positional components. Usually these are the two components yaw and pitch. (default: 2)

Returns:

The disposition of the event.

Return type:

pl.Expr

Raises:

TypeError – If position_columns not of type tuple, position_columns not of length 2, or elements of position_columns not of type str.