ppi

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ppi</title>
</head>
<body>
<script>
function ppi() {
var width = document.getElementById('width').value;
var height = document.getElementById('height').value;
var diagonal = document.getElementById('diagonal').value;
var ppicompute= (Math.sqrt(height * height + width * width)) / diagonal;
var ppivalue = document.getElementById('ppivalue');
document.getElementById("ppivalue").value = ppicompute.toString().substr(0,4);
}
</script>
width<br>
<input type="text" id="width">px<br>
height<br>
<input type="text" id="height">px<br>
diagonal<br>
<input type="text" id="diagonal">inch<br>
ppi<br>
<input type="text" id="ppivalue"><br>
<button onclick="ppi()">compute</button>
</body>
</html>

  

上一篇:innodb log file size 配置估算以及修改


下一篇:Vue/Egg大型项目开发(二)数据库设计