Scale coordinates
Hi Everyone!
I've got another question..
Say I have a rectangle made up of 4 points.
I would like to know how to scale this rectangle from its center point to a given scale factor (whilst maintaining its proportions obv).
How is this achievable...
A link to the relevant Maths would grandly suffice.
Kind Regards
Jayson
calculate the center of the rectangle (width/2 , height/2). translate it so that the center ist 0,0. apply factor and translate it back.
Hi thanks for the quick reply,
The part I actually need help with is how to apply the factor... the raw method to take the point and scale them up or down.
Thanks
Jayson
The part I actually need help with is how to apply the factor... the raw method to take the point and scale them up or down.
Thanks
Jayson
x' = (x-width/2)*factorX + width/2
y' = (y-height/2)*factorY + height/2
Sounds like your factorX == factorY, and that's fine.
y' = (y-height/2)*factorY + height/2
Sounds like your factorX == factorY, and that's fine.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement