circle_bundles.RP1AngleMetric

class circle_bundles.RP1AngleMetric(name='RP1_angle', base_name='RP^1', base_name_latex='\\mathbb{RP}^1')[source]

Bases: object

Geodesic distance on the real projective line \(\mathbb{RP}^1\) using angular coordinates.

The space \(\mathbb{RP}^1\) can be viewed as a circle with antipodal points identified. Angles are therefore taken modulo \(\pi\).

The distance between two angles is

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

This metric is commonly used when the base variable represents unoriented directions.

Parameters:
  • name (str)

  • base_name (str)

  • base_name_latex (str)

name

Metric identifier (default "RP1_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='RP1_angle', base_name='RP^1', base_name_latex='\\mathbb{RP}^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 projective geodesic distances between angle arrays.

Attributes

base_name

base_name_latex

name

pairwise(X, Y=None)[source]

Compute projective 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