Skip to content
Related Articles

Related Articles

Improve Article

Calculate sine of a value in R Programming – sin() Function

  • Last Updated : 01 Jun, 2020

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
My Personal Notes arrow_drop_up
Recommended Articles
Page :