Take the 2-minute tour ×
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.

I would like to find out a formula (mathematical equation(s)) for adjusting the position of any point enclosed in a rectangle when its corner point is repositioned such that (1) all other corner points remain in their place, and (2) all interior and boundary points are repositioned proportionally. This operation is typically associated with readjusting the bounding-box of a 2d polygon in a manner that "stretches" the polygon.

Let's say Ptl is the top-left corner of a bounding-box of a polygon and the point's location is (x,y) in Cartesian coordinates. Let's say the point is moved by (dx,dy), ie this point's new location is now Ptl'=(x+dx,y+dy). However, the three remaining corner points of the rectangle remain in their positions. If P is any point within the original rectangle, what will its new position be?

share|improve this question
    
As you observed, this kind of transformation is in general not even affine, so it's not going to have a matrix representation in the usual sense - what are you looking for? –  Anthony Carapetis Sep 8 '13 at 3:10
    
Let's say P=(x,y) is the top right corner in Cartesian coordinates. If it changes position by (dx,dy) I would like to find out a formula for calculating the new position of any point within the confines of the original bounding box of this transformation. I believe the formula to have a linear characteristic. Points closer to the corner should move by greater distance than points further away. Something like: T(Pi)=(Pi.x+(dx*(Pi.x-Pbl.x)/(P.x-Pbl.x)),Pi.y+(dy*(Pi.y-Pbl.y)/(P.y-Pbl.y)), where Pbl is the bottom-left corner, ie the change in distance along axis is proportional to point's loc. –  andrewz Sep 8 '13 at 11:39
    
I'll quote what I have written in my previous note, which states precisely what I want: '' I would like to find out a formula for calculating the new position of any point within the confines of the original bounding box of this transformation'' –  andrewz Sep 9 '13 at 16:02
    
It looks like your formula in the comment is right for the problem described in the comment. Do you want to change the moving corner from top-right to top-left? Or is there something about your formula that is not what you are seeking? –  Ned Sep 10 '13 at 15:20
    
@Ned My example solution is for the top right corner. How about a general solution for any corner C? –  andrewz Sep 10 '13 at 16:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.