Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个宽度:240 我有纵横比:2.40 我需要根据这两个变量来获取高度。公式是什么?
比率的定义:
ratio = width / height
公式:
height = width / ratio = 240 / 2.40 = 100
计算 2:40 的示例。使用 javascript 编程语言。
var width = 240 ; var rat1 = 2; var rat2 = 40; var ratio = width / rat1; var calculated_height = ratio * rat2;