# Calculating point on sphere surface where sun reflection to a target point occurs

Imagine a mirror sphere at position O with radius R, and a target point at position P, at distance d from the sphere origin.

There is an unknown point X on the surface of the sphere, where the light from the sun, represented by vector v, bounces directly towards point T.

I'm trying to solve for the angle θ, created by OT and OX, which describes the normal at which the angles towards T and v are equal, at the surface point X. I'm calling this angle α.

Here are the known variables:
O - center of sphere
T - target point
d - distance from sphere center to target
v - unit vector towards sun
γ - angle between OT and the unit vector v

Since we know positions O, T, and the unit vector v, we can break the problem into 2 dimensions, working on the plane created by OT and v.

This is the diagram I am using to try and solve the problem:

My approach was to work with the triangle OTX, since we know two of the sides, as well as the angle γ.

Since α and β must add up to π/2, we can assume:

OXT = α + β + β = π/2 + β

Since we know γ, we can also assume:

OTX = π - β - (γ+β) = π - 2β - γ

Using the law of sines, we can then state that:

d/sin(π/2+β) = r/sin(π-2β-γ)

In theory then we just have to solve for β. Once we know that, we can easily find θ:

α = γ - π/2 + β

However, I ran into problems when attempting to isolate β using a variety of trig identities. I was hoping someone might have a suggestion on how to do this. Or perhaps I'm totally off base and there's a more practical approach to solving the problem?

I'm extremely rusty with math and coming at this from a programming perspective, so please forgive any bad math notation/etiquette!