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

Related Articles

Getting tangent and hyperbolic tangent in Julia – tan(), tanh() and tand() Methods

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

The tan() is an inbuilt function in julia which is used to calculate tangent of the specified radian values.

Syntax: tan(x)

Parameters:

  • x: Specified radian values.

Returns: It returns the calculated tangent of the specified radian values.

Example:




# Julia program to illustrate 
# the use of tan() method
  
# Getting tangent of the specified
# radian values.
println(tan(0))
println(tan(30))
println(tan(90))
println(tan(44))

Output:

0.0
-6.405331196646276
-1.995200412208242
0.017704699278685777

The tanh() is an inbuilt function in julia which is used to calculate hyperbolic tangent of the specified values.

Syntax: tanh(x)

Parameters:

  • x: Specified values.

Returns: It returns the calculated hyperbolic tangent of the specified values.

Example:




# Julia program to illustrate 
# the use of tanh() method
  
# Getting hyperbolic tangent
# of the specified values.
println(tanh(0))
println(tanh(70))
println(tanh(90))
println(tanh(45))

Output:

0.0
1.0
1.0
1.0

The tand() is an inbuilt function in julia which is used to calculate tangent of the specified value in degrees.

Syntax: tand(x)

Parameters:

  • x: Specified value in degrees.

Returns: It returns the calculated tangent of the specified value in degrees.

Example:




# Julia program to illustrate 
# the use of tand() method
  
# Getting tangent of the specified value 
# in degree
println(tand(0))
println(tand(30))
println(tand(90))
println(tand(45))

Output:

0.0
0.5773502691896258
Inf
1.0

My Personal Notes arrow_drop_up
Last Updated : 26 Mar, 2020
Like Article
Save Article
Similar Reads