Let's suppose we have a sphere of radius r at a distance d from the observer
We define the following
O: observer
C: Center of the sphere
P: arbitrary visible point of the sphere (fromthe observer)
OC: line connecting the observer to the center of the sphere ( fixed length: d)
OP: Line connecting the observer and an arbitrary visible point of the sphere (variable length depending on the angle: a)
CP: Line connecting the center of the sphere and this arbitrary visible point (fixed length: r)
theta: angle between OC and OP
shi: angle between OC and CP
In case P is one of the "external" visible points of the sphere, using basic geometry we have that
theta_max = atan( r/ sqrt(d^2-r^2) )
shi_max = PI/2 - theta_max
For any other point, I got the following equations
r.cos(shi) + a.cos(theta) = d
r.sin(shi) = a.sin(theta)
I think these equations are right, but I can see no way to write them as shi=f(theta), since 'a' also varies with it.
Is it possible? Or is any of these steps wrong?
EDIT
Working with the latest two equations, we can get
tan(theta)= r.sin(shi)/(d-r.cos(shi))
but I would need to get shi=f(theta) if possible
Let's call the angle between CP and OP λ
. Solving for λ
is rather simple:
sin(λ) = sin(theta)*d/r
Now you know two angles within that triangle and the remaining one can be calculated from the angle sum of a triangle:
shi = Pi - theta - asin( sin(theta)*d/r )