Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body style="background-color: #000;">
- <div align="center" id="tools_lcalc">
- <h3 style="color: #fff;">
- <b><u>Hypotenuse Resolver</u></b>
- </h3>
- <h4 align="center" style="color:#fff;">
- <font size="2px">This is the hypotenuse calculator, enter side length 1 in one of the text boxes, and side length 2 in the other.
- <br style="width:1px; height: 2px;">Then click "Get Hypotenuse", to get the hypothenuse. Please note the number you get is already squared. </font>
- </h4>
- <div align="center" id="tools_hcalc">
- <textarea onfocus="clear1(this);" id="num1" rows="1" cols="35" style="width:100px; background-color: #000; color: #fff; text-align: center;">
- Leg 1
- </textarea>
- <textarea onfocus="clear2(this);" id="num2" rows="1" cols="35" style="width:100px; background-color: #000; color: #fff; text-align: center;">
- Leg 2
- </textarea>
- </div>
- <div align="center">
- <button onclick="calculate()" id="submit" align="center" style="color: #fff; background-color: #000; width=70px; height:27px;"> Get Hypotenuse </button>
- </div>
- <br>
- <hr style="background-color: 2px; border-style: solid; border-color: #fff; border-width: 4px;">
- <br>
- <div align="center" id="tools_lcalc">
- <h3 style="color: #fff;">
- <b><u>Leg Resolver</u></b>
- </h3>
- <h4 align="center" style="color:#fff;">
- <font size="2px">This is the leg resolver, enter the length of one of the legs in the text box that says "Leg", and enter the hypotenuse inside the box that says "Hypotenuse".<br style="width:1px; height: 2px;">Then click "Get Leg", to get the leg.</font>
- </h4>
- <textarea onfocus="clear1(this);" id="hypo" rows="1" cols="35" style="width:100px; background-color: #000; color: #fff; text-align: center;">
- Hypotenuse
- </textarea>
- <textarea onfocus="clear2(this);" id="leg" rows="1" cols="35" style="width:100px; background-color: #000; color: #fff; text-align: center;">
- Leg
- </textarea>
- </div>
- <div align="center">
- <button onclick="getleg()" id="gleg" align="center" style="color: #fff; background-color: #000; width=70px; height:27px;"> Get Leg </button>
- </div>
- <script id="calculation">
- function calculate() {
- var ogf = document.getElementById("num1").value
- var ogs = document.getElementById("num2").value
- var df = ogf * ogf;
- var ds = ogs * ogs;
- var ans = df + ds;
- var anst = Math.sqrt(ans);
- alert(anst);
- }
- function clear1(element)
- element.value = '';
- }
- function clear2(element) {
- element.value = '';
- }
- function getleg() {
- var ogl = document.getElementById("leg").value
- var ogh = document.getElementById("hypo").value
- var cc = ogh - ogl;
- var ans2 = Math.sqrt(cc);
- alert(ans2);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement