Ruby | CMath asin() Method
Last Updated :
07 Jan, 2020
asin() method is CMath class which is used to returns the arc sine of the given value.
Syntax: Math.asin(z)
Parameter: Here, z is the value whose arc sine is to be calculated.
Returns: This method returns the arc sine value of the z.
Example 1:
require 'cmath'
a = 0 . 3584
b = 2
puts "asin value of a : #{CMath.asin(a)}\n\n"
puts "asin value of b : #{CMath.asin(b)}\n\n"
|
Output:
asin value of a : 0.3665534738291246
asin value of b : 1.5707963267948966-1.3169578969248166i
Example 2:
require 'cmath'
a = 0
b = - 0 . 247
puts "asin value of a : #{CMath.asin(a)}\n\n"
puts "asin value of b : #{CMath.asin(b)}\n\n"
|
Output:
asin value of a : 0.0
asin value of b : -0.24958310188075922
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...