I have polygons comprised of lat/lon coordinates and I want to project them onto a plane that's appropriate for polygon operations (such as checking for intersections). In some cases, the polygons that I want to project might fall outside the valid area that can be projected (such as gnomonic being confined to less than a hemisphere).
Given an arbitrary center lon and lat, how can I clip polygons that are partially outside the valid range so I can project them? In the attached picture, note that the polygons and graticules are clipped.
The way I do a gnomonic projection currently is directly project coordinates in cartesian (ECEF) out from the center of the Earth onto a tangent plane. But I obviously can't project any points or lines where ray to a coordinate is greater than or equal to 90 degrees from the center lon and lat.
I'm looking for a method description as opposed to a pre-existing software package.