If the pole is 40 ft long. That's how long it is from bottom to top.
A line perpendicular to two intersecting lines at the point of intersection is perpendicular to the plane of those lines.
and in this case, I see no reason for Pythagorus, the 40 is a given.
(I'm sure I missed something.)