Here's a question? I have two line segments which have an angle between them. For the line segments, I know coordinates of their points. I need to be able to rotate one segment for one angle (for example, $\alpha$ needs to be $60^\circ$) - it doesn't matter in which direction is angle calculated, as long as it stays persistent. Because that I only know point of line segment, idea is to rotate other point around point of intersection for desired angle, and to get coordinates for that point after rotation. But I can not come to solution which works for every angle and where rotation direction (clockwise or counter-clockwise) is persistent. $(0, 0)$ is in top left corner, as shown on picture. You don't have to bother with theory (if you don't want), I need to apply this as algorithm. Thanks
![enter image description here](https://i.stack.imgur.com/vaEDd.png)