Hallo,
Ich hab ein Dreieck, es hat einen Winkel 90° W.
Ich hab auch zwei seiten a und b.
Hast wohl Hausaufgaben auf?
function Pythagoras(a,b)
{
return Math.sqrt(a*a+b*b);
// oder
// return Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
}
mit
<body onload="alert(Pythagoras(3,4))">
MfG, Thomas