My algebra is so rusty, this should be an easy one!
The area of a rectangle is
$$A = W \times H$$
If you're given $A$ (say $150$) and a ratio of $W:H$ (say $3:2$) how can you calculate $W$ and $H$?
My algebra is so rusty, this should be an easy one!
The area of a rectangle is
$$A = W \times H$$
If you're given $A$ (say $150$) and a ratio of $W:H$ (say $3:2$) how can you calculate $W$ and $H$?
Right so you have $W:H$ is $3:2$, which means $$150 = 3x \times 2x$$ So this is just a simple equation which you can solve for. That is $6x^{2}=150$ which says $x^{2} =25$ and hence $x =\sqrt{25}$ that is $x =5 $. So $W = 3 \times 5 =15 $ and $H= 2 \times 5 =10$ and you can see that they have ratio $3 : 2$.
I was looking for an answer for the same question. It's just that the other posts are kind of too complicated for me. I see it this way:
If you have given a width $a$ and a height $b$ and you know the $\textsf{area}$. You want to stretch each side with a fixed ratio of $x$ until you get the final size of the area. So you stretch $a$ with $x$ and $b$ with $x$ equals the $\textsf{area}$.
$$\begin{align*} (a\cdot x)\cdot(b\cdot x)&=\textsf{area}\\\\ (a\cdot b)\cdot x^2&=\textsf{area}\\\\ x^2&=\frac{\textsf{area}}{a\cdot b}\\\\ x&=\sqrt{\frac{\textsf{area}}{a\cdot b}} \end{align*}$$ $x$ is the ratio you are stretching. So you can multiply $x$ by $a$ and $b$ to get the new size of $a$ or $b$.
Assume:
So:
$x = y \cdot ratio$
Using substitution:
$area = (y\cdot ratio) \cdot y$
$area = y^{2} \cdot ratio$
$\frac{area}{ratio} = y^{2}$
$\sqrt{\frac{area}{ratio}} = y$
Now that you have y:
$x = \frac{area}{y}$
HINT $\rm\displaystyle\ \ \frac{W}H = \frac{3}2\ \Rightarrow\ 2\:W = 3\:H\:,\ $ so $\rm\ 300 = 2\:W\:H = 3\:H\:H\ \Rightarrow\ H = \ldots $
For anyone else looking for an answer in the form of a formula that can be "plopped" into Microsoft Excel (or similar apps) here's what worked for me:
Let's say you have three named cells in Excel:
oldX : the current image widtholdY : the current image heightdesiredArea : the desired area (x*y) of the image after resizing.
areaScale eg., 0.5 for 50%),desiredArea = ( oldX * oldY * areaScale )....finally, you can calculate the new values for Y, then for X:
Formula for newY is =FLOOR( SQRT( desiredArea / (oldX/oldY), 1)
Formula for newX is =FLOOR( (oldX * oldY) / newY, 1 )
(This was my reinterpretation of LucasY's answer above.)