pymovements.events.peak_velocity#

pymovements.events.peak_velocity(*, velocity_column: str = 'velocity', n_components: int = 2) Expr#

Peak velocity of an event.

The peak velocity is calculated as:

\[\text{Peak Velocity} = \max \left(\sqrt{v_x^2 + v_y^2} \right)\]

where \(v_x\) and \(v_y\) are the velocity components in \(x\) and \(y\) direction, respectively.

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

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

Returns:

The peak velocity of the event.

Return type:

pl.Expr

Raises:

ValueError – If number of components is not 2.