Learn and Learn

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

Ruby – Find Arc Tangent – atan() Method – Examples & Explanation

atan() a method in CMath library which is used to find the arc tangent of any given complex number in Ruby language.

atan() method in Ruby

atan() method exists in Standard CMath Library of Ruby. The purpose of this method is to provide perfect arc tangent of any given complex number.

Syntax of the atan() method in Ruby

Syntax of atan() method is:

Parameter of atan() method in Ruby

x – Where x is Any valid complex number. This parameter is required.
Note: If the x parameter is not a complex number, atan() method will return an error.


Return Value of atan()

atan() method will return the arc tangent of any given complex number.

Get the arc tangent of any complex number in Ruby



Ruby atan() (arc tangent) Example 1



Ruby atan() (inverse of tangent) Example 2



Ruby atan() (arc tangent) Example 3



Ruby atan() (arc tangent) Example 4



LearnAndLearn.com © 2018 - All rights reserved