PDA

View Full Version : Math.sin



JPM
08-15-2004, 02:57 PM
I need some help...
How would you write the following with javascript? (getting the answer, not the setup...)
Look at the attachment

dumpfi
08-15-2004, 03:16 PM
function asin_deg(y, hyp) {
alert('x = ' + Math.asin(y / hyp) * 180 / Math.PI + '');
}
asin_deg(5, 10);

dumpfi

JPM
08-15-2004, 03:22 PM
thanks! Is asin the same as sin-1 on the calculator/picture ?

jkd
08-15-2004, 08:22 PM
asin is short for Arcsin which is Sin-1 (inverse sin) on a calculator