cos()
是 julia 中的一个内置函数,用于计算指定弧度值的余弦。
Syntax: cos(x)
Parameters:
- x: Specified radian values.
Returns: It returns the calculated cosine of the specified radian values.
例子:
# Julia program to illustrate
# the use of cos() method
# Getting cosine of the specified
# radian values.
println(cos(0))
println(cos(30))
println(cos(90))
println(cos(44))
输出:
1.0
0.15425144988758405
-0.4480736161291702
0.9998433086476912
cosh()
是 julia 中的一个内置函数,用于计算指定值的双曲余弦。
Syntax: cosh(x)
Parameters:
- x: Specified values.
Returns: It returns the calculated hyperbolic cosine of the specified values.
例子:
# Julia program to illustrate
# the use of cosh() method
# Getting cosine of the specified values.
println(cosh(0))
println(cosh(30))
println(cosh(90))
println(cosh(45))
输出:
1.0
5.343237290762231e12
6.102016471589204e38
1.7467135528742547e19
cosd()
是 julia 中的一个内置函数,用于计算指定值的余弦(以度为单位)。
Syntax: cosd(x)
Parameters:
- x: Specified value in degrees.
Returns: It returns the calculated cosine of the specified value in degrees.
例子:
# Julia program to illustrate
# the use of cosd() method
# Getting cosine of the specified value
# in degree
println(cosd(0))
println(cosd(30))
println(cosd(90))
println(cosd(45))
输出:
1.0
0.8660254037844386
0.0
0.7071067811865476