0
$\begingroup$

I have an algorithm to write for an app. So I am given a reference rectangle with known width and length and I have bigger rectangle which sides I have to determine, where one side is known. I realize I could use ratios, but the problem is that I don't know if a known side of a bigger rectangle is width or length. How do I determine this?

$\endgroup$
  • $\begingroup$ If you just want any bigger rectangle just choose any $d>{ab\over c}$ where $a,b$ are width and length of the known rectangle and $c$ is the known side of the bigger rectangle. $\endgroup$ – cr001 Nov 17 '15 at 9:06
  • $\begingroup$ the bigger rectangle's sides should have the same ratio as the smaller one, but I can assume that the bigger given side is both length or width and that's the problem $\endgroup$ – Marty Nov 17 '15 at 9:11
  • $\begingroup$ Assuming the given length of the larger rectangle to be $c$, if $c>b$ where $b$ is the length of the smaller rectangle then either way will work. If $a<c<b$ where $a$ is the width of the smaller rectangle then only $d={bc\over a}$ will work. $\endgroup$ – cr001 Nov 17 '15 at 9:29
  • $\begingroup$ what I did is that I used area ratios in both cases where given side of a larger rectangle is length and width and then compared perimeter ratios with the one of a smaller rectangle. When the perimeter ratios and lengths ratios coincide than it's an answer I guess... $\endgroup$ – Marty Nov 17 '15 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.