Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Ruby – Find Inverse Arc Sine – asin() Method – Examples & Explanation

asin() method can be used to find the inverse arc sine of the any given complex number in Ruby programming language. CMath.asin() method exists in CMath library of Ruby language.

asin() Method in Ruby

asin() method exists in Standard CMath Library of Ruby. The purpose of this method is to provide perfect arc sine of the given complex number.

Syntax of the asin() Method in Ruby

Syntax of asin() Method is:

 

Parameters of asin() Method in Ruby

Parameter Description
xAny valid complex number. This parameter is required.

Note: If the x parameter is not a complex number, asin() method will return an error.

 

Return Value of asin()

asin() method will return the arc sine of the given numeric complex number.

Ruby – Get the asin() of any Given Numbers


Output

0.7803985799853912+2.649196177806475i

 

Ruby asin() Function Example 2


Ouput

-0.7803985799853912+2.649196177806475i

 

Ruby Non-Complex numbers in asin()Function Example 3


Output

Error

 

Ruby – Use of Negative Value in asin() Function Example 4


Output

-0.7803985799853841-2.649196177806471i

 

Ruby – Get the asin() of Particular Number Example 5


Output

1.5707963267948966-2.7686593833135738i

 

Loading...
LearnAndLearn.com © 2018 - All rights reserved