Add complex number parameter in C#

Hi,

I would like to use the AddComplexNumber as an input parameter but I can’t figur out the format for the default value. Thank you.

Screen Shot 061

Thank you @PeterFotiadis, I’ve already tried to reference System.Numerics but I get this error message

Assuming that you have 2 collections for real, imaginary :

Well, I figured out how to add GH_ComplexNumber.

But I would like to covert it to the System.Numerics.Complex, is there a simple way?

Does it not work to just do

var ca = new Grasshopper.Kernel.Types.Complex(2, 3);
var cb = new System.Numerics.Complex(ca.Real, ca.Imaginary);

?

Yeah, it works, sorry I was just stuck on the issue.

1 Like