CodesJava

Easy learning with example program codes

JavaScript math cos() method

The JavaScript math cos() method is used to get the cosine of a number.

Syntax:

Math.cos(n)

Parameters
n: It represents the number whose cosine have to be get.

Returns
Cosine of a number.

Example

<!DOCTYPE html>
<html>
<body>
<script>  
document.writeln(Math.cos(5));  
</script>  
</body>
</html>

Output

0.28366218546322625
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status