Lets assume a complex impedance like Z = (123 + 321j) * ohm
use uom::fmt::DisplayStyle;
use uom::si::complex64::ElectricalResistance;
use uom::si::electrical_resistance::ohm;
use uom::num_complex::Complex64;
fn main() {
let n = Complex64::new(123.0,321.0);
let unit = ElectricalResistance::new::<ohm>(n);
println!("{} -> {}", n, unit.into_format_args(ohm,DisplayStyle::Abbreviation));
assert_eq!(n,unit.get::<ohm>());
}
I have looked at the implementing PR: while i would expect the pure unit conversion factor to be a floating point type, the actual conversion operation must be in the complex numbers, otherwise the operation is one-way (there are infinite solutions to |z|^2 = re^2 + im^2 for a single given z; think vectors describing a circle of radius z).
Im gonna have a go at either understanding where im wrong in my assumptions, or fixing this, as i really want complex impedance :D
Heya, i have run into the following issue:
Lets assume a complex impedance like
Z = (123 + 321j) * ohm
this fails:
343.7586362551492
being the norm of the number.I have looked at the implementing PR: while i would expect the pure unit conversion factor to be a floating point type, the actual conversion operation must be in the complex numbers, otherwise the operation is one-way (there are infinite solutions to
|z|^2 = re^2 + im^2
for a single given z; think vectors describing a circle of radius z).Im gonna have a go at either understanding where im wrong in my assumptions, or fixing this, as i really want complex impedance :D