compute_angular_acceleration#
- movement.kinematics.compute_angular_acceleration(data, window=None, in_degrees=False)[source]#
Compute the angular acceleration of a 2D orientation.
The orientation is given as 2D vectors, e.g. the output of
compute_forward_vector().- Parameters:
data (
DataArray) – The input orientation vectors, containingtimeandspaceas dimensions.spacemust have exactly the coordinates["x", "y"]. The vectors need not be of unit length.window (
int|None) – IfNone(default), the angular acceleration is computed by differentiating the central-difference angular velocity. Otherwise, the size of the centred rolling window, representing the fixed number of observations to which a least-squares quadratic is fitted; the angular acceleration is its second derivative. Must be an odd integer greater than 2, and requires a uniformly sampledtimecoordinate.in_degrees (
bool) – IfFalse(default), the output is in radians per unit of time squared. IfTrue, it is in degrees per unit of time squared.
- Returns:
The angular acceleration, with the dimensions of the input, without
space. The unit of time is that of thetimecoordinate (seconds or frames).- Return type:
See also
compute_angular_time_derivativeThe underlying function used.
compute_angular_velocityThe first time-derivative of orientation.
Examples
>>> from movement.kinematics import ( ... compute_angular_acceleration, ... compute_forward_vector, ... ) >>> head_vector = compute_forward_vector( ... ds.position, "left_ear", "right_ear" ... )
Least-squares estimate over the 9 observations centred on each time point, in degrees per unit of time squared:
>>> aha = compute_angular_acceleration( ... head_vector, window=9, in_degrees=True ... )