Description
Locate a continuous turn in one of equally sized half-open sectors relative to an explicit angular origin; no compass naming convention.
A turn is one full revolution, equal to 360 degrees or 2π radians. Circular coordinates wrap modulo one, so a shortest signed change can differ from direct subtraction. Sector indexes partition the circle, while unwrapping observations requires a direction convention for exact half-turn ties.
Locate a continuous turn in one of equally sized half-open sectors relative to an explicit angular origin; no compass naming convention.
When to use this tool
Use this tool to locate a continuous turn in one of equally sized half-open sectors relative to an explicit angular origin; no compass naming convention.
How to use the tool and how it works
- Enter turn, sectors, origin using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.index. Interpret signs, units, ordering and null values using the rules below.
Normalize turn−origin modulo one, multiply by sectors and take floor for the zero-based sector index. Each sector includes its lower boundary and excludes its upper boundary.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| turn | Signed continuous angular coordinate in turns. | Finite number satisfying the stated comparisons. |
| sectors | Number of equal circular sectors, integer 1–1,000,000. | Finite safe integer satisfying the stated bounds. |
| origin | Caller-defined angular origin in turns. | Finite number satisfying the stated comparisons. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.index | Zero-based half-open sector index relative to origin. |
{
"input": {
"turn": 0.3,
"sectors": 4,
"origin": 0
},
"output": {
"result": {
"index": 1
}
}
} Limitations and assumptions
- sectors is an integer 1–1,000,000. The origin and direction convention are caller-defined; no compass names are assigned.
- All angle observations, origins, distances and tolerances here use turns, not radians or degrees. Floating comparisons can affect values extremely close to a wrap boundary.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Keep angular units and origin consistent. Use the ambiguity audit before relying on shortest-step unwrapping; extra revolutions and motion between sparse observations need other evidence.
References
Similar or alternative tools
- Turn Sector Boundary Distance
Compute circular turn distance to the nearest equal-sector boundary, not the sector center or a linear clock endpoint.
- Turn Sector Center
Return the normalized center turn of an explicit zero-based equal angular sector; origin is a caller coordinate.