在 Julia 中获取正弦和双曲正弦 - sin()、sinh() 和 sind() 方法
sin()
是 julia 中的一个内置函数,用于计算指定弧度值的正弦值。
Syntax: sin(x)
Parameters:
- x: Specified radian values.
Returns: It returns the calculated sine of the specified radian values.
例子:
# Julia program to illustrate
# the use of sin() method
# Getting sine of the specified
# radian values.
println(sin(0))
println(sin(30))
println(sin(90))
println(sin(44))
输出:
0.0
-0.9880316240928618
0.8939966636005579
0.017701925105413577
sinh()
是 julia 中的一个内置函数,用于计算指定值的双曲正弦值。
Syntax: sinh(x)
Parameters:
- x: Specified values.
Returns: It returns the calculated hyperbolic sine of the specified values.
例子:
# Julia program to illustrate
# the use of sinh() method
# Getting sine of the specified values.
println(sinh(0))
println(sinh(30))
println(sinh(90))
println(sinh(45))
输出:
0.0
5.343237290762231e12
6.102016471589204e38
1.7467135528742547e19
sind()
是 julia 中的内置函数,用于计算以度为单位的指定值的正弦值。
Syntax: sind(x)
Parameters:
- x: Specified value in degrees.
Returns: It returns the calculated sine of the specified value in degrees.
例子:
# Julia program to illustrate
# the use of sind() method
# Getting sine of the specified value
# in degree
println(sind(0))
println(sind(30))
println(sind(90))
println(sind(45))
输出:
0.0
0.5
1.0
0.7071067811865476