Description
Calculate a signed longitude difference without wrapping around the date line.
Geographic coordinates use explicit angular, axis and vertical-datum conventions. Unwrapped longitude difference differs from the shortest circular separation, and a north-based bearing differs from a rightward-zero screen rotation. Ellipsoidal and orthometric heights require a compatible geoid-undulation model.
Calculate a signed longitude difference without wrapping around the date line.
When to use this tool
Use Longitude Difference Unwrapped Sign when checking the stated geographic label, angular or height-reference convention.
How to use the tool and how it works
- Enter firstLongitudeDegrees, secondLongitudeDegrees. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read signedGap. Use the output convention below.
Return secondLongitudeDegrees-firstLongitudeDegrees without wrapping.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstLongitudeDegrees | First Longitude Degrees | Required. Finite number. |
| secondLongitudeDegrees | Second Longitude Degrees | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| signedGap | Raw second-first longitude degrees with no circular wrapping. | Required. Finite number. |
{
"input": {
"firstLongitudeDegrees": 12,
"secondLongitudeDegrees": 17
},
"output": {
"signedGap": 5
}
} Limitations and assumptions
- The signed difference may exceed 180 or 360 degrees; it is not the shortest antimeridian-aware separation or a geographic distance.
- 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 authoritative coordinate/datum definitions and appropriate geodesic, projection and geoid models for actual locations, distances and height conversion.
References
Similar or alternative tools
- Geographic Radius Angular Fraction
Convert signed arc length and a supplied radius to central angle and turns.
- Geographic Bearing Screen Rotation Crosswalk
Convert a north-referenced bearing to a clockwise or counterclockwise screen rotation.