title: How to find new coordinates of rectangle after rotation
body: <p>Y coordinate of rectangle after rotation on canvas. As shown in image the rectangle will be rotated on its center point axis. After rotation and canvas is restored I want to find the new X,Y coordinates like one shown in second image, before rotation points were 50,50 and after rotation they could be 62,40.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/581837/wpf-getting-new-coordinates-after-a-rotation"><strong>similar question</strong></a> so I took the images from there but that question is for some WPF and my requirement is JS. How to find coordinates of all corners of rectangle after rotation?</p>
  
  <p><img src="https://i.stack.imgur.com/LjWXs.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Qn96O.jpg" alt="enter image description here"></p>