源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <h1>JavaScript Math.sin()</h1> <p>Math.sin(x) 返回x的正弦值:</p> <p>角弧度 = (度角) * PI / 180.</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "90 度的正弦值是: " + Math.sin(90 * Math.PI / 180); </script> </body> </html>
运行结果