Getting cosine and hyperbolic cosine in Julia – cos(), cosh() and cosd() Methods
Last Updated :
26 Mar, 2020
The cos()
is an inbuilt function in julia which is used to calculate cosine of the specified radian values.
Syntax: cos(x)
Parameters:
- x: Specified radian values.
Returns: It returns the calculated cosine of the specified radian values.
Example:
println(cos( 0 ))
println(cos( 30 ))
println(cos( 90 ))
println(cos( 44 ))
|
Output:
1.0
0.15425144988758405
-0.4480736161291702
0.9998433086476912
The cosh()
is an inbuilt function in julia which is used to calculate hyperbolic cosine of the specified values.
Syntax: cosh(x)
Parameters:
Returns: It returns the calculated hyperbolic cosine of the specified values.
Example:
println(cosh( 0 ))
println(cosh( 30 ))
println(cosh( 90 ))
println(cosh( 45 ))
|
Output:
1.0
5.343237290762231e12
6.102016471589204e38
1.7467135528742547e19
The cosd()
is an inbuilt function in julia which is used to calculate cosine of the specified value in degrees.
Syntax: cosd(x)
Parameters:
- x: Specified value in degrees.
Returns: It returns the calculated cosine of the specified value in degrees.
Example:
println(cosd( 0 ))
println(cosd( 30 ))
println(cosd( 90 ))
println(cosd( 45 ))
|
Output:
1.0
0.8660254037844386
0.0
0.7071067811865476
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...