the ray inside the prism is parallel to the base so the incident angle is whatever causes minimum deviation
if you have the incident angle, you also have the emergent angle since i=e when the ray is parallel to base
and you can use the incident angle to do some trigonometry and get the distance of point A to the prism (same as point B to the prism)