# A simple projection trick for orthographic globe clipping

**URL:** <https://talk.observablehq.com/t/a-simple-projection-trick-for-orthographic-globe-clipping/10590>\
**Category:** Show and tell\
**Created:** [February 22, 2026, 12:22pm UTC](https://talk.observablehq.com/t/a-simple-projection-trick-for-orthographic-globe-clipping/10590 "2026-02-22T12:22:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bloechle](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bloechle/32/9752_2.png) [@Bloechle](https://talk.observablehq.com/u/Bloechle)\
**Post date:** [February 22, 2026, 12:22pm UTC](https://talk.observablehq.com/t/a-simple-projection-trick-for-orthographic-globe-clipping/10590/1 "2026-02-22T12:22:59Z")

</div>

Hi everyone,

While working on teaching material for a web visualization course, I stumbled upon a simple trick that I haven’t seen documented before (though it may well be known, and I’d love to hear if someone has seen it elsewhere).

The idea: instead of clipping polygons at the horizon with spherical Sutherland-Hodgman, you can modify the projection so that back-hemisphere points project beyond the globe radius, then let a circular SVG clipPath do all the work.

The core is 4 lines of JavaScript:

js

```auto
const cosC = sinφc * sinφ + cosφc * cosφ * Math.cos(dλ);
if (cosC < 0) {
  const d = Math.hypot(px, py) || 1;
  const s = (2 * R - d) / d;
  px *= s; py *= s;
}

```

The transformation d → 2R - d is continuous at the horizon (no seam), and pushes antipodal points far outside the circle where the clipPath hides them. I call it “Horizon Overflow”.

I put together a notebook with an interactive explanation and a side-by-side comparison showing what happens at each step:

> **[Horizon Overflow](https://observablehq.com/@sugarcube/globe)**
>
> A 4-line globe projection trick Orthographic globes require clipping polygons at the horizon - D3-geo uses ~500 lines of spherical Sutherland-Hodgman for this. Here's a simpler alternative that I haven't found mentioned elsewhere, though it may well...

Obviously this doesn’t replace d3-geo for serious cartography: there’s no great-circle resampling, and edge precision depends on vertex density. But for interactive globes with standard resolution data (countries-110m), it works well and is much simpler to understand and implement.

I’m curious:

- Has anyone seen this approach before? I’d be happy to credit prior work.
- Are there edge cases I might have missed?

Thanks for any feedback!

Jean-Luc

---

<div class="post-metadata">

**Author:** ![tezzutezzu](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tezzutezzu/32/9783_2.png) [@tezzutezzu](https://talk.observablehq.com/u/tezzutezzu)\
**Post date:** [May 5, 2026, 8:40am UTC](https://talk.observablehq.com/t/a-simple-projection-trick-for-orthographic-globe-clipping/10590/2 "2026-05-05T08:40:28Z")

</div>

Thanks for sharing!
