I have the following mathematical Problem and somehow I'm not able to solve it.
Lets say I have an optical device which is able to rotate around it z-axis for azimuth and around its y-axis for elevation. If I now have a object which I want to observe its pretty easy to calculate the angles for elevation/azimuth if the camera is in the coordinate frame origin e.g. the center of my rotation.
But my Problem is now my Camera sensor is not in the center of this rotation but has a fixed offset of (x, y,z) to the center. Is there any possibility to calculate the angle of azimuth and elevation so that the camera sensor looks at the object. I know the position of the object and the offset of the camera sensor.
I made an very simplified 2D drawing that illustrates the Problem. It would be very nice if someone knows how to do it :)
I will be assuming that the target point (T) is at a much greater distance than the offset of your optical sensor (S) from its effective center of rotation (C).
orient the optical sensor such that its center axis is parallel to the connecting line (CT) between the center of rotation and the target point. Our viewport can then be simplified to a parallel projection along the same connecting line.
now if you took a photograph in this orientation, you would miss the target by an offset x' and y' that is identical to the offset x and y of your optical sensor to its effective center of rotation.
going back to a perspective view, this x' and y' offset is now experienced as an error in azimuth and elevation, given by arctan(x'/CT) and arctan(y'/CT) respectively.
this error can now be subtracted from our original sensor orientation, resulting in a well approximated alignment at an assumed large target distance.
The following sketch shows the error in azimuth (as seen from above). Note that the z offset can be ignored altogether, since we're assuming large target distance and use parallel projection (no depth of field) for calculating the offset.
In summary, we're assuming the target has an offset instead of the sensor, and we're correcting for the resulting error.