oxilean_std/complex/complex_arg_group.rs
1//! # Complex - arg_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 /// Argument: arg(z) ∈ (-π, π].
11 pub fn arg(self) -> f64 {
12 self.im.atan2(self.re)
13 }
14 /// Convert to polar form (r, θ).
15 pub fn to_polar(self) -> (f64, f64) {
16 (self.abs(), self.arg())
17 }
18}