Delta

Teste seno

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