0
$\begingroup$

How would i calculate the scale between two rectangles?

e.g. I have the following

Grid layout

what will the height be of the rectangle at index 8 given 2 is 2 and 15 is 5

what will the height be of the rectangle at index 8 given 2 is 4 and 15 is 5

what would i need to do to calculate the ?

  • 0
    Don't you mean the height at $2$ is $2$?2017-01-08
  • 0
    yes sorry, 2 is 22017-01-08

1 Answers 1

0

Assuming the height increases linearly with the index, you get the equation of a straight line. I.e. you have the two points $(i_1, h_1) = (2,2)$ and $(i_2, h_2) = (15,5)$ and the straight line between them gives the equation $$\frac{h_2-h_1}{i_2-i_1}=\frac{h-h_1}{i-i_1}$$

Inserting the values and rearranging gives $$h=\frac{3i+20}{13}$$

At $i=8$ we then get $$h=\frac{44}{13}$$

  • 0
    where is h and i coming from in this first equation?2017-01-08
  • 0
    h (=height) and i (=index) come from the equation of a straight line, a linear equation.2017-01-08
  • 0
    is it possible to expand on how you re-arranged to 20? I can see how you get to 13, and 3i.2017-01-08
  • 0
    $h-2=\frac{3}{13}*(i-2)$=>$h=\frac{3}{13}i-\frac{6}{13}+\frac{26}{13}$2017-01-08
  • 0
    thank you, you are my hero2017-01-08
  • 0
    argh, i still dont understand this h and i part, which are the formulas i should be using to plug into that bit?2017-01-08
  • 0
    At index $i=2$ you get height $h=\frac{3*2+20}{13}=\frac{26}{13}=2$. At index $i=15$ you get height $h=\frac{3*15+20}{13}=\frac{65}{13}=5$. At index $i=8$ you get height $h=\frac{3*8+20}{13}=\frac{44}{13}=3\frac{5}{13}$.2017-01-09
  • 0
    but 3∗2+20 and 3∗15+20 where did the 20 come from? how was this part worked out? i cant see any part of the formula in the original answer which would give me 20 to plug in? :(2017-01-09
  • 0
    I showed you where the $20$ comes from in my comment from $19$ hours ago: $h=\frac{3}{13}i-\frac{6}{13}+\frac{26}{13}=\frac{3}{13}i+\frac{20}{13}=\frac{3i+20}{13}$.2017-01-09
  • 0
    For future readers, these links have been quite helpful for me in learning what the above means - http://mathonweb.com/help_ebook/html/graphs_2.htm - method 3 gives explanation of above equation. http://mathonweb.com/help_ebook/html/systems_1.htm gives explanation of elimination2017-01-11
  • 0
    thanks so much for your help, i cracked it tonight :)2017-01-12
  • 0
    Glad I could help :)2017-01-12