Description
Wrap to minus from modulo 360.
Longitude is an angular coordinate with a seam and equivalent values separated by full turns. Interval direction, endpoint inclusion, and half-turn policy must be fixed before comparing or averaging longitudes.
Wrap to minus from modulo 360.
When to use this tool
Use Longitude Halfturn Tie Direction Label when you need a longitude normalization, interval, or seam-policy calculation.
How to use the tool and how it works
- Enter from, to, preferEast. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read difference, tied. Inspect tied before interpreting the associated values.
Wrap to minus from modulo 360. At exactly 180 return +180 when preferEast is true or -180 otherwise; elsewhere return the representative below 180 and above -180, plus the tied flag.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| from | From | Required. Finite number. |
| to | To | Required. Finite number. |
| preferEast | Prefer East | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| difference | Difference | Required. Finite number. |
| tied | Tied | Required. Boolean. |
{
"input": {
"from": 0,
"to": 180,
"preferEast": false
},
"output": {
"difference": -180,
"tied": true
}
} Limitations and assumptions
- Angles are degrees, with positive differences interpreted eastward. Tie handling is exact floating-point equality; no geographic path or coordinate bounds are checked.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a full spherical or ellipsoidal geometry method for routes and areas. Retain an explicit seam and endpoint policy when splitting, sorting, or averaging geographic data.
References
Similar or alternative tools
- Longitude Signed Unwrapped Representative
Compute turn as floor((reference-longitude+180)/360), add 360 times turn to longitude, and return that unwrapped representative.
- Longitude Arc Complement
Return the smaller of their absolute difference and its 360-degree complement as shortArcDegrees, and 360 minus that result as longArcDegrees.