Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Math Topics » geometry.puzzles.independent

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 ]
Daryl

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.

Thanks


Date Subject Author
2/16/12
Read Ratio of square sizes
Daryl
2/16/12
Read Re: Ratio of square sizes
Daryl

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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.