# Calculate new X & Y coordinate based on compressed or enlarged rectangle

I have two Rectangles as Rect1

    ___________ x'', y''
|     |dy   |
|     .x',y'|
|           |
|           |
0,0-------------


Here the value of x'' & y'' can vary from being smaller or larger than Rect2 Then there is fixed Rect2

    ___________ x, y
|           |
|     .x',y'|
|     |dy'  |
|     |     |
0,0-------------


How to calculate dy' distance based on value of other coordinatates that includes (x'',y'',x',y',dy) & (x,y)

Please forgive if you find wrong presentation of the question detail

• What's the relationship between the two rectangles? Actually, I think you should just rewrite the whole question. Don't put any diagrams because it's only confusing. Instead, define the rectangles and their relationships. What information do you have? What do you want to calculate exactly? I think you might need Pythagoras theorem ... – Matti P. Feb 5 at 12:56
• It's odd that you would change the dimension of dy from above to below the y coordinate. Otherwise it is a simple application of the corresponding dilation.values to the x and y coordinates. – Phil H Feb 5 at 13:32
• sure, I will try decomposing the question – Hina Khuman Feb 5 at 13:51