Orthographic world projection, how to detect if the point is on the back side

72 Views Asked by At

I'm trying to make orthographic projection of the world map. I use this common equations:

$$\begin{cases}x&=&\cos \phi \sin(\lambda - \lambda_0)\\ y&=&\cos \phi_1 \sin \phi - \sin \phi_1 \cos \phi \cos(\lambda - \lambda_0)\end{cases}$$

I have something like this globe:

enter image description here

How can I detect if the point (long, lat) is on the front side of the globe or not? (I want to hide the points from the back side)

I have latitude, longitude and reference point (lambda0 and phi1 params).

Thanks.

Update. Range examples (boundary cases):

range examples

So ideally I need a rule that describes these ranges.