Skip to content

Ross-Morgan/croot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Croot

No Std Label Build Crates.io Crates.io (recent)

A Rust library for finding complex and principal roots of real and complex values;

Examples

Principal root

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));

Real index

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]

Complex index

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

About

A Rust crate for finding real and complex roots

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages