sin()
function in R Language is used to calculate the sine value of the numeric value passed to it as argument.
Syntax: sin(x)
Parameter:
x: Numeric value
Example 1:
# R code to calculate sine of a value # Assigning values to variables x1 < - - 90
x2 < - - 30
# Using sin() Function sin(x1) sin(x2) |
Output:
[1] -0.8939967 [1] 0.9880316
Example 2:
# R code to calculate sine of a value # Assigning values to variables x1 < - pi
x2 < - pi / 3
# Using sin() Function sin(x1) sin(x2) |
Output:
[1] 1.224647e-16 [1] 0.8660254
Article Tags :