# Ruby | Complex angle function

Complex#angle() : angle() is a Complex class method which returns the angle part of the polar form of complex value.

Syntax: Complex.angle()

Parameter: Complex values

Return: angle part of the polar form of complex value.

Example #1 :

 `# Ruby code for Complex.angle() method ` ` `  `# declaring Complex value ` `a = Complex(``200``) ` ` `  `# declaring Complex value ` `b = Complex(-``1``, ``4``) ` ` `  `# declaring Complex value ` `c = Complex(``'i'``) ` ` `  ` `  `# use of angle()   ` `puts ``"Complex angle form : #{a.angle}\n\n"` ` `  `puts ``"Complex angle form : #{b.angle}\n\n"` ` `  `puts ``"Complex angle form : #{c.angle}\n\n"`

Output :

```Complex angle form : 0.0

Complex angle form : 1.8157749899217608

Complex angle form : 1.5707963267948966

```

Example #2 :

 `# Ruby code for Complex.angle() method ` ` `  `# declaring Complex value ` `a = Complex(``20``, ``90``) ` ` `  `# declaring Complex value ` `b = Complex(``'i'``) ` ` `  `# declaring Complex value ` `c = Complex(``100``, -``500``) ` ` `  `# use of angle()   ` `puts ``"Complex angle form : #{a.angle}\n\n"` ` `  `puts ``"Complex angle form : #{b.angle}\n\n"` ` `  `puts ``"Complex angle form : #{c.angle}\n\n"`

Output :

```Complex angle form : 1.3521273809209546

Complex angle form : 1.5707963267948966

Complex angle form : -1.373400766945016

```

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.