title: Calculate required position to keep object centered when camera is rotated
body: <p>I always want to keep an object in the center of view of a camera.
  The object can not change its position.</p>
  
  <p>The camera can be rotated.
  The camera can move up and down.
  The object should always be centered in the view of the camera.</p>
  
  <p>So when I rotate the camera by -45°, I would like to know the Y position of the camera at which the rotated camera would still directly face the object.</p>
  
  <p>I know the "horizontal" distance between the camera and the object (as this never changes), and I know the angle of the camera. </p>
  
  <p>How could the "required camera position Y value" be calculated?</p>
  
  <p>Thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/cqOj0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cqOj0.png" alt="enter image description here"></a></p>