Calculate Height for Image/Video based on Aspect Ratio and Width
-
27-09-2019 - |
Question
I have a width: 240 I have aspect ratio: 2.40 I need to get the height based on those two variables. What's the formula?
Solution
Definition of the ratio:
ratio = width / height
Formula:
height = width / ratio = 240 / 2.40 = 100
OTHER TIPS
example of calculating 2:40 . using javascript programming language.
var width = 240 ;
var rat1 = 2;
var rat2 = 40;
var ratio = width / rat1;
var calculated_height = ratio * rat2;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow