Can somebody explain what is the best method to align two sides of two entities ? For instance, let us imagine that we have one straight line that is not parallel with a given side of a rectangle, whatever the intersection angle is between this line and the rectangle side of interest. How to quickly rotate the rectangle so that the side of interest is perfectly aligned and become parallel with the straight line ?

Thanks in advance.