Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- /* Para: Triângulo agudo ou reto, lado 3 em 0 no eixo Y e eixo X positivo */
- var L1 = new Number(prompt("Magnitude lado 1: "));
- var L2 = new Number(prompt("Magnitude lado 2: "));
- var A = new Number(prompt("Angulo lado 2 com lado 3: "));
- var H = Math.sin(Math.PI / 180 * A) * L2;
- var Y = Math.sqrt(L2*L2 - H*H);
- var Z = Math.sqrt(L1*L1 - H*H);
- var X = Y + Z;
- alert("Lado 3 = " + X);
- undefined;
Advertisement
Add Comment
Please, Sign In to add comment