I have a practical spherical geometry problem that I'm having trouble cracking. I'm illuminating a planar surface with an LED that has a Lambertian intensity distribution, i.e. the intensity drops off as the cosine of the angle from the perpendicular (Intensity = $I_0 * cos($\theta$)). So if an LED at point ( 0,0,1) is pointed normal to a planar surface at the origin (0,0,0), the intensity distribution in the x-y plane is easy to determine - maximum at (0,0,0) dropping off with intensity with the cosine of the angle. What I'd like to figure out is the intensity distribution across the x-y plane when the LED is pointed at the origin, but at any arbitrary position on the surface of a half-sphere/dome with radius normalized to 1, pointed at the origin. In other words, I'm looking for an equation that will describe the intensity at any point in the x-y plane (z=0) for any LED position/angle on that sphere, not just the normal direction. I think I can figure it out for the direction for any point along the projection of the xyz radius vector onto the xy plane, but am having problems generalizing it for any arbitrary x-y point. I have the LED position coordinates in xyz format, but can convert them to spherical coordinates if necessary. I've already figured out how to compensate for the change in intensity due to inverse-square drop-off; I'm only looking for the intensity variation from the Lambertian intensity distribution. Any help would be appreciated.
Well, I'm an idiot. I've been trying to solve this via spherical trigonometry, using the origina origin. This is the wrong approach - there's a simpler way. Set the position of the LED as the origin, and write vectors from that point to both the original origin (the location the LED is pointed at), and the point you want the intensity at. The angle between the vectors is the angle I'm looking for, and is easily calculated.