No you don't need it, it is simply a way to find the intersecting point. You can also us math to do it by finding the X distance from you to the edge and comparing it to the X distance from you to the treasure, then taking that % of the Y distance and that'll give you the position.
This in my opinion is a lot harder to understand/show in a forum.