Apr. 17, 2014

Resizing with maintained aspect ratio applet

Maybe I'm just way too old school, but when dealing with resizing anything, I like to jot down a simple fractional equation. For example, if there's a video that's 530 x 298 pixels and you need to resize that to 505 pixels wide, and maintain the aspect ratio:

First, setup the simple equation like so:

\frac {530}{298}=\frac {505}{y}

Second, cross-multiply the fraction:

530*y = 505 * 298

Then solve for y, divide both sides by 530:

y = \frac{505 * 298}{530}

And you may want to round the answer:

y = 283.9433962264...

y \approx 284

Original Resized (Rounded)
Width:
Height:

 

In general terms, if you have:

\frac {a}{b}=\frac {c}{d}

Formulas for solving c and d are:

c = \frac{(a* d)}{b}\ ; d = \frac{(b* c)}{a}

Find this interesting, or useful? Consider sharing the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

Posts on this blog solely represent my personal opinions and technical experience.

© 2009-2017 Edin (Dino) Beslagic