Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Calculate tangent of a value in R Programming – tan() Function

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

tan() function in R Language is used to calculate the tangent of the numeric value passed to it as argument.

Syntax: tan(x)

Parameter:
x: Numeric value

Example 1:




# R code to calculate tangent of a value
  
# Assigning values to variables
x1 <- -90
x2 <- -30
  
# Using tan() Function
tan(x1)
tan(x2)

Output:

[1] 1.9952
[1] 6.405331

Example 2:




# R code to calculate tangent of a value
  
# Assigning values to variables
x1 <- pi
x2 <- pi / 3
  
# Using tan() Function
tan(x1)
tan(x2)

Output:

[1] -1.224647e-16
[1] 1.732051
My Personal Notes arrow_drop_up
Last Updated : 01 Jun, 2020
Like Article
Save Article
Similar Reads