CalcWorldHub
Free online calculator · no signup

Spherical body Cartesian line of sight clearance calculator

Check whether the finite straight segment between two exterior Cartesian points clears an opaque reference sphere.

4,000 tools
Spherical body Cartesian line of sight clearance calculator — First geocentric xyz endpoint (km), Second geocentric xyz endpoint (km), Opaque spherical body radius (km) and calculation method
Spherical body Cartesian line of sight clearance calculator: inputs and calculation method.

How to use this calculator

Check whether the finite straight segment between two exterior Cartesian points clears an opaque reference sphere.

  1. Enter First geocentric xyz endpoint (km), Second geocentric xyz endpoint (km), Opaque spherical body radius (km). Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Spherical body Cartesian line of sight clearance explained

For two geocentric endpoints, the nearest point on the finite segment to the body center sets the minimum radius along the ray. Comparing that radius with the opaque-body radius determines geometric clearance.

Inputs, symbols, and units

a — First geocentric xyz endpoint (km)
Length measured in kilometres. Use comma-separated values in the stated order.
b — Second geocentric xyz endpoint (km)
Length measured in kilometres. Use comma-separated values in the stated order.
R — Opaque spherical body radius (km)
Length measured in kilometres.

Formula and method

u=clamp[−a·(b−a)/|b−a|²,0,1]; minimum altitude=|a+u(b−a)|−R.

Project the center onto the infinite endpoint line and clamp the closest point to the actual segment. This avoids testing an irrelevant extension behind either endpoint. Compare the closest radius with the spherical body radius.

A worked scenario

First geocentric xyz endpoint (km) = 7000,0,0; Second geocentric xyz endpoint (km) = 5000,5000,0; Opaque spherical body radius (km) = 6371.

  • Minimum ray-segment altitude: 128.3368362 km
  • Geometric visibility: Clear line of sight
  • Endpoint separation: 5385.16480713 km
  • Closest point fraction along segment: 0.48275862

Both endpoints lie outside the sphere, yet the chord between them can still pass below the surface. Endpoint altitude alone is insufficient to determine visibility.

Assumptions and edge cases

Geometric straight rays and a spherical opaque body. Both endpoints must lie on or outside the sphere. No terrain, oblateness, atmosphere, diffraction, or refraction. A relative numerical band labels grazing geometry.

Reading the outputs

Negative clearance means blocked by the sphere. The closest-point fraction identifies where along the finite segment the minimum occurs.

Frequently asked questions

Can two orbiting spacecraft both be high enough but hidden?

Yes. The central body can intersect their connecting chord.

Is this a horizon-distance formula?

It generalizes a horizon check to any pair of exterior Cartesian endpoints.

Does clear visibility imply a usable radio link?

No. It tests only geometric obstruction.

How do I use the Spherical body Cartesian line of sight clearance calculator?

Enter First geocentric xyz endpoint (km), Second geocentric xyz endpoint (km), Opaque spherical body radius (km). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Spherical body Cartesian line of sight clearance?

First geocentric xyz endpoint (km) = 7000,0,0; Second geocentric xyz endpoint (km) = 5000,5000,0; Opaque spherical body radius (km) = 6371. Minimum ray-segment altitude: 128.3368362 km Geometric visibility: Clear line of sight Endpoint separation: 5385.16480713 km Closest point fraction along segment: 0.48275862 Both endpoints lie outside the sphere, yet the chord between them can still pass below the surface. Endpoint altitude alone is insufficient to determine visibility.