endas.localization.CoordinateSystem

class endas.localization.CoordinateSystem

Bases: object

Coordinate system abstraction.

Each coordinate system is characterized by its dimension (i.e. the number of components each coordinate takes) and must provide a distance metric via the distance() method.

ndim

Returns the number of dimensions.

is_cartesian

Returns True if this is a Cartesian coordinate system.

distance(A, B, out=None)

Implements distance metric for this coordinate system.

The method computes distance between pairs of points in sets A and B. The dimension of each point must be equal to self.ndim and are stored row-wise. Therefore, the sets A and B must be arrays of shape (n, ndim), where n is the number of points to process.

Parameters:
  • B (A,) – n x ndim arrays containing n coordinates in the sets A and B
  • out – Existing array of length n where the result should be stored, is possible. If None is given, new array is allocated.
Returns:

Array of length n containing the computed distances.