Calculate Inverse cosine of a value in R Programming – acos() Function
acos() function in R Language is used to calculate the inverse cosine value of the numeric value passed to it as argument.
Syntax: acos(x)
Parameter:
x: Numeric value
Example 1:
# R code to calculate inverse cosine of a value # Assigning values to variables x1 <- -1x2 <- 0.5 # Using acos() Functionacos(x1)acos(x2) |
Output:
[1] 3.141593 [1] 1.047198
Example 2:
# R code to calculate inverse cosine of a value # Assigning values to variablesx1 <- 0.224587x2 <- 0.456732 # Using acos() Functionacos(x1)acos(x2) |
Output:
[1] 1.344277 [1] 1.096478


