cos()
function in R Language is used to calculate the cosine value of the numeric value passed to it as argument.
Syntax: cos(x)
Parameter:
x: Numeric value
Example 1:
x1 < - 90
x2 < - 30
cos(x1)
cos(x2)
|
Output:
[1] -0.4480736
[1] 0.1542514
Example 2:
x1 < - pi
x2 < - pi / 3
cos(x1)
cos(x2)
|
Output:
[1] -1
[1] 0.5