oxilean_std/complex/complex_asin_group.rs
1//! # Complex - asin_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 sine: arcsin(z) = -i * log(iz + sqrt(1 - z^2)).
11 pub fn asin(self) -> Option<Self> {
12 let one = Self::one();
13 let z2 = self.mul(self);
14 let inner = one.sub(z2).sqrt();
15 let iz = Self::i().mul(self);
16 let arg = iz.add(inner);
17 let log = arg.log()?;
18 Some(Self::i().neg().mul(log))
19 }
20}