oxilean_std/complex/complex_atan_group.rs
1//! # Complex - atan_group Methods
2//!
3//! This module contains method implementations for `Complex`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use super::complex_type::Complex;
8
9impl Complex {
10 /// Inverse tangent: arctan(z) = (i/2) * log((i+z)/(i-z)).
11 pub fn atan(self) -> Option<Self> {
12 let i = Self::i();
13 let numer = i.add(self);
14 let denom = i.sub(self);
15 let ratio = numer.div(denom)?;
16 let log = ratio.log()?;
17 Some(i.scale(0.5).mul(log))
18 }
19}