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