A simple way that doesn't require you to do any 3d maths would be to create a little triangle around the point — imagine it represents an actual triangle on the floor that the point lies in the middle of — project all three points using the Google Earth project
method, then work out the signed area of the 2d triangle. If the area is positive then draw, if the area is negative then don't.
So, e.g. for latitude and longitude (n, m)
, project (n-0.01, m)
, (n, m+0.01)
and (n+0.01, m)
to get 2d locations (a, q)
, (b, r)
and (c, s)
.
Then test the sign of (b - a) * (s - q) - (c - a) * (r - q)
— that's actually double the signed area of a triangle but doubling doesn't affect the sign. The formula is pretty well known; here's a StackExchange source.
I've typed this extemporaneously so it's possible I've confused my handedness. If so, just flip the test: negative for draw, positive for don't.