Connect two rectangles with a straight line

Please refer to this post for a short tutorial on the topic: How to create a Line Draw function in Axure with some math and trigonometry