Last updated on Sep 04, 2024.

netsse.tools.misc_func.ang_diff#

netsse.tools.misc_func.ang_diff(alpha, beta, unit='deg')#

Calculates the signed difference between two angles.

Parameters:
  • alpha (float or array_like) – Input angle as a scalar value or as an array of angles.

  • beta (float or array_like) – Input angle as a scalar value or as an array of angles.

  • unit ({'deg','rad'}, optional) – Specifies the unit of the angles as 'rad' or 'deg'. The default is 'deg'.

Returns:

delta – The output difference between alpha and beta in the range [-180,180] degrees.

Note

This function subtracts alpha from beta, i.e., computes the signed difference beta-alpha, taking into account the circularity at 360 degrees.

Return type:

float or array_like

See also

re_range

Converts angles to a new range of values.

ang_mean

Calculates the mean angle from an array of angular data.

ang_std

Calculates the circular standard deviation for an array of angular data.

Example

>>> delta = ang_diff(alpha, beta, unit='deg')