capturegraph.scheduling.distance.angle
#
Angle Distance - Circular Angular Distance#
Measures distance between angles accounting for their circular nature. For example, 359° is close to 1°.
angle_degrees(sigma_deg=10.0, period=360.0)
#
Create a circular angular distance function for degrees.
Measures the shortest angular distance between two angles on a circle. By default, assumes 360° period (full rotation).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_deg
|
float
|
Normalization factor in degrees. Angles within |
10.0
|
period
|
float
|
The period of the angle in degrees. Default is 360° (full circle). Use 180° for angles that wrap at ±90° (like latitude). |
360.0
|
Returns:
| Type | Description |
|---|---|
Callable[[float, float], float]
|
A distance function |
Example
Source code in capturegraph-lib/capturegraph/scheduling/distance/angle.py
angle_radians(sigma_rad=np.pi / 18, period=2 * np.pi)
#
Create a circular angular distance function for radians.
Measures the shortest angular distance between two angles on a circle. By default, assumes 2π period (full rotation).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_rad
|
float
|
Normalization factor in radians. Angles within |
pi / 18
|
period
|
float
|
The period of the angle in radians. Default is 2π (full circle). |
2 * pi
|
Returns:
| Type | Description |
|---|---|
Callable[[float, float], float]
|
A distance function |