Skip to content
Related Articles

Related Articles

Improve Article

Calculate Inverse cosine of a value in R Programming – acos() Function

  • Last Updated : 01 Jun, 2020
Geek Week

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 <- -1
x2 <- 0.5
  
# Using acos() Function
acos(x1)
acos(x2)

Output:

[1] 3.141593
[1] 1.047198

Example 2:




# R code to calculate inverse cosine of a value
  
# Assigning values to variables
x1 <- 0.224587
x2 <- 0.456732
  
# Using acos() Function
acos(x1)
acos(x2)

Output:

[1] 1.344277
[1] 1.096478
My Personal Notes arrow_drop_up
Recommended Articles
Page :