Landscape by height points

Hello. I have got array of height points and squares. How to do appropriate coordinates for squares` angles?