Suppose I have a 8x6 rectangle, with its lower left corner at the origin (0, 0). I want to scale this rectangle by 0.5 at an anchor point (3, 3). So the resulting rectangle is 4x3, but I cannot figure out how to compute the distance from the origin to the lower left corner of the new rectangle. Help is appreciated.
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
Scaling by 0.5 about the center (3,3) is the same as translating by (-3,-3), scaling by 0.5 about (0,0), then translating by (3,3). So, to find the coordinates of the lower left corner of the new rectangle, take the coordinates of the lower left corner of the original rectangle, subtract 3 from each coordinate, multiply each coordinate by 0.5, and add 3 to each coordinate. Once you have the point's coordinates, you can find its distance from the origin. |
|||||||||||||||||
|
|
If you want to scale by .5 with anchor (a,b), then (x,y) will be sent to ((a+x)/2,((b+y)/2), the midpoint of the segment connecting the two points. |
|||
|
|
