<p> ;</p>
<p> ;</p>
<p><style>body{font-family:Arial,sans-serif;margin:0;padding:0}h1,h2{text-align:center;margin:30px 0 10px}form{display:flex;flex-direction:column;align-items:center;margin:30px 0}label{margin-top:10px}input[type="number"]{width:150px;padding:5px;border-radius:5px;border:none;box-shadow:1px 1px 5px rgba(0,0,0,.3)}button{background-color:#4CAF50;color:#fff;padding:10px;border:none;border-radius:5px;box-shadow:1px 1px 5px rgba(0,0,0,.3);cursor:pointer;margin-top:20px;font-size:18px;transition:background-color .3s ease-in-out}button:hover{background-color:#3e8e41}p.result{margin-top:30px;text-align:center;font-size:24px;font-weight:bold}</style>
</p>
<h2>TV Mounting Height Calculator</h2>
<h4>Please enter the following information:</h4>
<form>
<div><label for="tv-size">Diagonal TV size (inches): </label> <input id="tv-size" max="90" min="40" required="" type="number" /></div>
<div><label for="viewing-distance">Viewing distance (feet): </label> <input id="viewing-distance" max="15" min="3" required="" type="number" /></div>
<div><label for="eye-level">Eye level height from the floor (inches): </label> <input id="eye-level" max="100" min="35" required="" type="number" /></div>
<p><button type="button">Calculate</button></form>
<p id="result" class="result"> </p>
<p><style>
 form div {
 display: inline-block;
 margin-right: 10px;
 }
 form label {
 display: inline-block;
 width: 250px;
 }
 form input {
 width: 150px;
 padding: 5px;
 border-radius: 5px;
 border: none;
 box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
 }
 button {
 background-color: #4CAF50;
 color: white;
 padding: 10px;
 border: none;
 border-radius: 5px;
 box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
 cursor: pointer;
 margin-top: 20px;
 font-size: 18px;
 transition: background-color 0.3s ease-in-out;
 }
 button:hover {
 background-color: #3e8e41;
 }
 p.result {
 margin-top: 30px;
 text-align: center;
 font-size: 24px;
 font-weight: bold;
 }
</style>
<p> <script>
	function calculate() {
		// Get the input values
		const tvSize = parseFloat(document.getElementById('tv-size').value);
		const viewingDistance = parseFloat(document.getElementById('viewing-distance').value);
		const eyeLevel = parseFloat(document.getElementById('eye-level').value);</p>
<p>		// Calculate the recommended TV mounting height in inches
		const tvh = Math.sqrt((tvSize**2 *9) / (16 **2 +9 **2)).toFixed(0);
		const mountingHeight = Math.round((eyeLevel + ((viewingDistance*12) * 0.1763269))-(tvh/2));
		const tvvd = Math.round((tvSize * 1.67)/12);</p>
<p>		// Display the result
		document.getElementById('result').innerHTML = `Recommended TV Mounting Height: <br /> ${mountingHeight} inches from floor to bottom of the TV<br />Recommended TV Viewing Distance: ${tvvd} feet`;
	}
</script></p>