no its quite easy, you just have to project them both to the same plane.
i'm doing a pic, just wait...
you pivot x around until it is horizontal, then project it straight down until it intersects the horizontal line of the top of the beam. Then measure 'y', the blue line, to get...