Note that there are some explanatory texts on larger screens.

plurals
  1. POCalculate scaling factor for converting point1( x,y coordinates) of one rectangle to Point1( x,y) of a different rectangle
    text
    copied!<p>Process of scaling x,y coordinates of one rectangle to other rectangle coordinates is pretty simple as better explained at this link</p> <p><a href="http://www.icoachmath.com/math_dictionary/scale_factor.html" rel="nofollow">http://www.icoachmath.com/math_dictionary/scale_factor.html</a></p> <p>if we have two rectangle one is having Maxwidth: 2000 and Maxheight: 1000</p> <p>and second rectangle of size MaxWidth : 4000 and MaxHeight = 2000</p> <p>so scale factor for converting coordinate of rect1 to rect2 would be </p> <p>for x in rect2 : (x in rect1) * (MaxWidth of Rect2/ MaxWidht of Rect1) for y in rect2 : (y in rect1) * (MaxHeight of Rect2/ MaxHeight of Rect1)</p> <p>but what should be scale factor when </p> <p>for one rectangle center is origin(X,Y - 0,0) would be at the center and there would be negative values for x and y as well if you go left from center then x would be in negative and in right side it would be positive same for Y, if you go up then y would be positive but if you go to bottom, thenY Would be negative, so extents of this rectangle tends to ( -MaxWidth to +MaxWidth, -MaxHeight to +MaxHeight)</p> <p>Now we have second rectangle which is having center at most left and top most position (most left and top most-0,0) and as we have to travel in right direction along x axis and down along y axis, So there would be always positive values for x and y.</p> <p>So, how to calculate scale factor for converting coordiantes of rectangle which has the origin at center of rectanlge(MaxWidth/2,MaxHeight/2) to the rectanlge which has origin at most left and top most position</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload