• Advertisement
Sign in to follow this  

Scale coordinates

This topic is 2874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
x' = (x-width/2)*factorX + width/2
y' = (y-height/2)*factorY + height/2

Sounds like your factorX == factorY, and that's fine.

Share this post


Link to post
Share on other sites
you can transform any coordinate like that it doesnt matter what shape the polygon has.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement