Skip to content

Main content

Turn Sector Boundary Distance

Compute circular turn distance to the nearest equal-sector boundary, not the sector center or a linear clock endpoint.

Loading tool…

Description

Compute circular turn distance to the nearest equal-sector boundary, not the sector center or a linear clock endpoint.

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.

Compute circular turn distance to the nearest equal-sector boundary, not the sector center or a linear clock endpoint.

When to use this tool

Use this tool to compute circular turn distance to the nearest equal-sector boundary, not the sector center or a linear clock endpoint.

How to use the tool and how it works

  1. Enter turn, sectors, origin using the input definitions below.
  2. Run the operation. Resolve malformed-input errors before interpreting the result.
  3. Read result.distance. Interpret signs, units, ordering and null values using the rules below.

Normalize (turn−origin)×sectors modulo one to p, then return min(p,1−p)/sectors in turns.1

Input fieldMeaning and unitsAccepted input
turnSigned continuous angular coordinate in turns.Finite number satisfying the stated comparisons.
sectorsNumber of equal circular sectors, integer 1–1,000,000.Finite safe integer satisfying the stated bounds.
originCaller-defined angular origin in turns.Finite number satisfying the stated comparisons.
Output fieldInterpretation
resultObject containing the fields below.
result.distanceNearest periodic sector-boundary distance, in turns.
json
{
  "input": {
    "turn": 0.3,
    "sectors": 4,
    "origin": 0
  },
  "output": {
    "result": {
      "distance": 0.05
    }
  }
}

Limitations and assumptions

  • The result measures the nearest periodic sector boundary, not distance to the sector center or a linear endpoint.
  • 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

  1. Tool behavior and example: Turn Sector Boundary Distance — tool.io

Similar or alternative tools

  • Turn Sector Center

    Return the normalized center turn of an explicit zero-based equal angular sector; origin is a caller coordinate.

  • Turn Sector Index

    Locate a continuous turn in one of equally sized half-open sectors relative to an explicit angular origin; no compass naming convention.