Description
Choose the nearer or farther of two supplied endpoint distances.
Distance calculations require a metric, coordinate convention, unit basis and tie policy. Selecting the nearer endpoint differs from computing distance to the full segment. A circular shortest-angle difference also needs an explicit choice between equally short positive and negative half turns.
Choose the nearer or farther of two supplied endpoint distances.
When to use this tool
Use Segment Endpoint Distance Choice when you already have firstEndpointDistance, secondEndpointDistance, chooseFarthest and need to choose the nearer or farther of two supplied endpoint distances.
How to use the tool and how it works
- Enter firstEndpointDistance, secondEndpointDistance, chooseFarthest. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read selectedDistance, firstEndpointChosen. Inspect firstEndpointChosen before interpreting the associated values.
Require both distances>=0; choose min or max and report firstEndpointChosen using inclusive comparison.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstEndpointDistance | First Endpoint Distance | Required. Finite number; minimum 0. |
| secondEndpointDistance | Second Endpoint Distance | Required. Finite number; minimum 0. |
| chooseFarthest | Choose Farthest | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| selectedDistance | Selected Distance | Required. Finite number. |
| firstEndpointChosen | True on equality under both nearest and farthest selection policies. | Required. Boolean. |
{
"input": {
"firstEndpointDistance": 3,
"secondEndpointDistance": 5,
"chooseFarthest": false
},
"output": {
"selectedDistance": 3,
"firstEndpointChosen": true
}
} Limitations and assumptions
- Ties choose the first endpoint under either policy. This does not calculate point-to-segment distance, inspect geometry or choose the nearest interior point.
- 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 the actual coordinates and intended metric when geometric distance is required. Preserve reference normalization and angular tie conventions in the full calculation; supplied endpoint distances or squared-norm residuals do not establish the underlying geometry.
References
Similar or alternative tools
- Vector Distance Squared Norm Crosscheck
Cross-check supplied squared distance against a coordinate-difference norm.
- Normalized Distance Reference Change
Compare one supplied distance normalized by two positive references.