libera_utils.geolocation.angle_between#

libera_utils.geolocation.angle_between(v1: ndarray, v2: ndarray, degrees: bool = False)#

Returns angle between vectors v1 and v2, in units of radians (default) or degrees. N is the number of vectors D is the dimension of the space

Parameters:
  • v1 (numpy.ndarray) – Vector(s) 1. May be shape (D,) or (N, D).

  • v2 (numpy.ndarray) – Vector(s) 2. May be shape (D,) or (N, D).

  • degrees (bool) – Specify True to return result in degrees. Default is False (returns radians).

Returns:

Angle between v1 and v2 in radians (optionally in degrees)

Return type:

float or numpy.ndarray