Angles¶
circumplex.utils.angles
¶
Angle utilities and predefined angle sets.
This module provides tools for working with circular angles, including conversion between degrees and radians, and standard angle sets for circumplex models.
| CLASS | DESCRIPTION |
|---|---|
AngleStart |
Enumeration for angle starting positions. |
Degree |
Angular measurement in degrees. |
Radian |
Angular measurement in radians. |
| FUNCTION | DESCRIPTION |
|---|---|
octants |
Get octant angles starting from a specified position. |
degrees_to_radians |
Convert degrees to radians. |
radians_to_degrees |
Convert radians to degrees. |
cosine_form |
Cosine function with amplitude, displacement and elevation parameters. |
sort_angles |
Sort angles and corresponding scores in ascending order. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
OCTANTS |
Standard octant angles in degrees.
TYPE:
|
QUADRANTS |
Standard quadrant angles in degrees.
TYPE:
|
POLES |
Standard pole angles in degrees.
TYPE:
|
OCTANTS
module-attribute
¶
Standard octant angles in degrees.
Returns the eight standard positions on a circumplex circle, spaced 45 degrees apart, starting from 90 degrees (North).
QUADRANTS
module-attribute
¶
Standard quadrant angles in degrees.
Returns the four standard quadrant positions on a circumplex circle, spaced 90 degrees apart.
POLES
module-attribute
¶
Standard pole angles in degrees.
Returns the two primary axis positions (vertical poles) on a circumplex circle.
Degree
¶
Bases: float
Angular measurement in degrees.
A float subclass representing an angle in degrees, with conversion methods to radians.
Examples:
| METHOD | DESCRIPTION |
|---|---|
to_radians |
Convert to radians. |
__repr__ |
Return a compact string representation, e.g., '90°'. |
to_radians
¶
Radian
¶
Bases: float
Angular measurement in radians.
A float subclass representing an angle in radians, with conversion methods to degrees.
Examples:
| METHOD | DESCRIPTION |
|---|---|
to_degrees |
Convert to degrees. |
__repr__ |
Return a compact string representation, e.g., '1.571 rad'. |
to_degrees
¶
octants
¶
Get octant angles starting from a specified position.
| PARAMETER | DESCRIPTION |
|---|---|
start
|
Starting position for the octants (default is 90 degrees).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[Shape['8'], Float]
|
Array of octant angles in degrees starting from the specified position. |
Examples:
>>> octants(AngleStart.ONE)
array([ 0., 45., 90., 135., 180., 225., 270., 315.])
>>> octants(AngleStart.FIVE)
array([180., 225., 270., 315., 0., 45., 90., 135.])
Source code in src/circumplex/utils/angles.py
degrees_to_radians
¶
Convert degrees to radians.
| PARAMETER | DESCRIPTION |
|---|---|
degrees
|
Angle(s) in degrees
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float | ndarray
|
Angle(s) in radians |
Examples:
>>> degrees_to_radians(180)
3.141592653589793
>>> degrees_to_radians(OCTANTS)
array([1.57..., 2.35..., 3.14..., ...])
Source code in src/circumplex/utils/angles.py
radians_to_degrees
¶
cosine_form
¶
cosine_form(theta: NDArray[Shape[Any], Float], ampl: float, disp: float, elev: float) -> NDArray[Shape[Any], Float]
Cosine function with amplitude, displacement and elevation parameters.
This is the mathematical model used in the Structural Summary Method.
| PARAMETER | DESCRIPTION |
|---|---|
theta
|
Angular positions in radians.
TYPE:
|
ampl
|
Amplitude of the cosine curve.
TYPE:
|
disp
|
Angular displacement in radians.
TYPE:
|
elev
|
Elevation (mean level) of the cosine curve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[Shape[Any], Float]
|
Predicted values at each theta position. |
Source code in src/circumplex/utils/angles.py
sort_angles
¶
sort_angles(angles: NDArray[Shape[Any], Float], scores: NDArray[Shape[Any], Float]) -> tuple[NDArray[Shape[Any], Float], NDArray[Shape[Any], Float]]
Sort angles and corresponding scores in ascending order.