The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Math Topics » geometry.puzzles

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Ratio of square sizes
Replies: 1   Last Post: Feb 16, 2012 5:32 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ] Topics: [ Previous | Next ]

Posts: 2
Registered: 2/16/12
Ratio of square sizes
Posted: Feb 16, 2012 3:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

So I'm out of my league on this math problem. I'll try to explain as simply as possible. Any help would be awesome. This is a piece of Javascript I am writing but the math is my issue.

I have a template that is built on a 4200 x 4200 square. That template draws squares based on coordinates contained within that template. {L,T,R,B} The template can be applied to any document size {activeDocument}. If that document size is not square, my ratios are off.

Here are my formulas.

wd = width of template
hd = height of template

maxWidth = (activeDocument.width)/2; //width of active document divided in half
maxHeight = activeDocument.height; //height of active document

ratioRec = wd/hd; //aspect ratio of template
ratioView = maxWidth/maxHeight; //aspect ratio of document

ratio = ratioView/ratioRec;
ratioW = maxWidth/wd;
ratioT = (maxHeight/hd);

//Sizing variables, this is where the problem is
left = (left * ratioW);
right = (right * ratioW) ;
top = (top * ratioT);
bottom = (bottom * ratioT) ;

Thanks for any help you might have on this. If something is not clear or need more information, please let me know.


Date Subject Author
Read Ratio of square sizes
Read Re: Ratio of square sizes

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.