A Rust library for finding complex and principal roots of real and complex values;
Can be used with either a real or complex
use croot::prelude::*;
let principal = principal_root(81.0, 4.0);
assert_eq!(principal, Complex64::from(3.0));
For finding roots where the index is a real number
Returns a vector containing all roots.
use croot::prelude::*;
let roots = root(16.0, 4).approx(10);
roots; // [4, -4, 4i, -4i]
For finding roots where the index is a complex number
Returns a complex number and a multiplicative period
use croot::prelude::*;
use num_complex::Complex64;
let index = Complex64::new(3.0, 4.0);
let (principal, period) = complex_root(10.0, index).approx(10);
principal; // first root
period; // number to multiply by to get next root