title: Java: Coordinate Transformation - Rotation & Scale
body: <p>Given is a rotated rectangle which is inscribed into another rectangle.<br>
  Both rectangles have their own coordinate systems.<br>
  In the inscribed &amp; rotated rectangle there is a point <strong>P</strong> with the coordinates relative to this rectangle (red).<br>
  Wanted are the coordinates of this points relative to the outer rectangle (green):<br>
  <strong>EDIT:</strong> Given are also the width and height of both rectangles + the angle of the rotation</p>
  
  <p>Image of an overview: <img src="https://i.stack.imgur.com/lw1Gh.png" alt="http://i.imgur.com/QH96n7x.png"></p>
  
  <p>My attempts with a transform matrix (setRotate() &amp; setScale()) failed and with Trigonometry I neither got it working.</p>
  
  <p>How can I calculate the position of point <strong>P</strong> relative to the outer rectangle?</p>
  
  <p>Thanks in advance!</p>