Click to See Complete Forum and Search --> : function


tintin_taurus
04-09-2003, 08:03 AM
}:confused:

i'm not so sure if this is corrrect,
cause there's seems to be an error.



function calculate2() {
with (document.num) {
y.value= Number(0.5) * Number(d.value) * 1/Math.tan(x)* Number(a.value);
}
}:confused:

the formula that i'm suppose to use is
y=0.5 D cot a
--------------------------------------------------------------------
i have try editing the function:
function calculate2() {
with (document.num) {
y.value= 0.5 * d.value * (1/Math.tan(x.value));
}
}

it does work but then the problem is they the output is totally wrong
for example:
0.5* 5*1/tan30=4.33012
but the output is -0.39029988040414803.

gil davis
04-09-2003, 08:30 AM
First of all, you should have continued with your other thread instead of starting a new one.

Second of all, the x in Math.tan(x) is where you put the angle.

Please make your request clearer, and give an example with the expected result.