Calculate Height for Image/Video based on Aspect Ratio and Width
Asked Answered
G

2

25

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?

Gym answered 11/8, 2010 at 19:12 Comment(0)
H
74

Definition of the ratio:

ratio = width / height

Formula:

height = width / ratio = 240 / 2.40 = 100

Hausmann answered 11/8, 2010 at 19:15 Comment(2)
And width = height * ratioMagus
This answer might also be usefull #8014978Magus
A
12

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;
Aphid answered 5/3, 2017 at 22:52 Comment(1)
Thanks for simple and easy understanding of finding other value ..if we have one and the ratio.. :)Interosculate

© 2022 - 2024 — McMap. All rights reserved.