use-complex
use-complex provides a small complex-number layer for RustUse: rectangular-form storage, an explicit Imaginary<T> newtype, standard arithmetic operators, and float-only polar helpers where the standard library already provides the necessary trigonometric functions.
Install
[]
= "0.0.1"
Basic usage
use Complex;
let value = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Arithmetic
use Complex;
let lhs = new;
let rhs = new;
assert_eq!;
assert_eq!;
assert_eq!;
let quotient = lhs / rhs;
assert!;
assert!;
Imaginary numbers
use ;
let imaginary = new;
let lifted = from;
assert_eq!;
assert_eq!;
Polar form
use FRAC_PI_3;
use Complex;
let value = from_polar;
let = value.to_polar;
assert!;
assert!;
License
Licensed under MIT OR Apache-2.0.