circle_bundles.S1AngleMetric

class circle_bundles.S1AngleMetric(name='S1_angle', base_name='S^1', base_name_latex='\\mathbb{S}^1')[source]

Bases: object

Geodesic distance on the circle \(\mathbb{S}^1\) using angles.

Points are represented by angles (in radians). The distance between two angles is the shorter arc length between them on the circle:

\[d(\theta_1, \theta_2) = \min\left(|\theta_2 - \theta_1|, 2\pi - |\theta_2 - \theta_1|\right).\]

This metric is appropriate when the base space is a circle and data are naturally parameterized by angles.

Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

name

Metric identifier (default "S1_angle").

Type:

str

base_name

Short name of the base space for plots/UI.

Type:

str

base_name_latex

LaTeX symbol used in summaries and tables.

Type:

str

__init__(name='S1_angle', base_name='S^1', base_name_latex='\\mathbb{S}^1')
Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

Return type:

None

Methods

__init__([name, base_name, base_name_latex])

pairwise(X[, Y])

Compute circular geodesic distances between angle arrays.

Attributes

base_name

base_name_latex

name

pairwise(X, Y=None)[source]

Compute circular geodesic distances between angle arrays.

Parameters:
  • X (ndarray) – Array of angles (any real values), shape (n,).

  • Y (ndarray | None) – Optional array of angles, shape (m,). If omitted, uses X.

Returns:

Distance matrix of shape (n, m).

Return type:

D