求js 数学公式的一些简单的方法,函数?

求js 数学公式的一些简单的方法,函数

三国纷争
浏览 1159回答 3
3回答

繁华开满天机

JS中可以通过sqrt获得数字的平方根JS中我们可以通过sqrt()函数获得数字的平方根.语法如下:Math.sqrt(x) ;下面来看一些sqrt()实例:<script language='JavaScript' type='text/JavaScript'><!--document.write(Math.sqrt(4)); // output is 2document.write("<br>");document.write(Math.sqrt(64)); // output is 8document.write("<br>");document.write(Math.sqrt(9)); // output is 3document.write("<br>");document.write(Math.sqrt(27)); // output is 5.196152422706632document.write("<br>");document.write(Math.sqrt(0.36)); // output is 0.6document.write("<br>------------<br>");document.write(Math.sqrt(-64)); // output is Nandocument.write("<br>");document.write(Math.sqrt(-9)); // output is NaN//--></script>

郎朗坤

楼主应该是提问三角函数这些公式吧。。。。var pi = Math.PI;function degToRad(x) { return ( x/(360/(2*pi)) ); }function radToDeg(x) { return ( x*(360/(2*pi)) ); }function pow(nv){return Math.pow(nv,2); }var yscalar=Math.sqrt(pow(xscalar/Math.sin(radToDeg(vdir)))-pow(xscalar));其他三角函数类同,查阅手册

杨__羊羊

var a=0;var b=1;var c=2;var d=3;var e= (a*1)+(b*1)-(c*1)/(d*1);
打开App,查看更多内容
随时随地看视频慕课网APP