hookeai.data_generation.spdg.patch.mean_rotation_angle_2d

mean_rotation_angle_2d(x1_arrays, x2_arrays)[source]

Compute mean rotation angle between pairs of vectors in 2D.

The i-th rotation angle is computed from x1 to x2 arrays, stored in x1_arrays[i, :] and x2_arrays[i, :], respectively.

Parameters:
  • x1_arrays (numpy.ndarray(2d)) – 1D arrays stored as numpy.ndarray(n_arrays, 2).

  • x2_arrays (numpy.ndarray(2d)) – 1D arrays stored as numpy.ndarray(n_arrays, 2).

Returns:

mean_angle_deg – Mean rotation angle (degrees) from x1 to x2, contained between -180 and +180 degrees.

Return type:

float