ฟังก์ชัน sin() ของอ็อบเจกต์ Math ยอมรับมุม (เป็นเรเดียน) และส่งกลับค่าไซน์ของมัน
ไวยากรณ์
ไวยากรณ์ของมันคือดังต่อไปนี้
Math.sin(90)
ตัวอย่าง
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.sin(90);
document.write("sine value of the given angle: "+result);
</script>
</body>
</html> ผลลัพธ์
sine value of the given angle: 0.8939966636005579