cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Complex Numbers
ian_jmp
Level X

This add-in allows you to define and manipulate complex numbers in JMP as in Microsoft Excel.

This is an updated version that fixes a bug in 'IMDIV()' (see below).

Yet another updated version that makes IMARGUMENT() adhere to the same convention as Excel.

Comments
gkelly1

Hi Ian,

I haven't been able to get the IMDIV or IMPRODUCT to work with 2 columns of complex numbers.  Can you share an example of those two functions? 

Thanks

ian_jmp

Sorry for the delay. It turns out that I made a slip with IMDIV(), but IMPRODUCT() worked. Many thanks for drawing my attention to this. I've posted an updated version which fixes the bug and has expanded demo data.

To call the two functions you mention from JSL, you can do, for example:

// Define two complex numbers

c1 = Complex:COMPLEX(3, 13);

c2 = Complex:COMPLEX(7, 17);

// Multiplication

c3 = Complex:IMPRODUCT(c1, c2);

// Division

c4 = Complex:IMDIV(c1, c2);

Print(c3, c4);

(assuming you have the add-in installed and activated).

Please do let me know if you see other issues.

gkelly1

Hi Ian,

Much thanks for creating this addin and for fixing the IMDIV.  I believe I also found another issue with the IMARGUMENT.  Here is the result from Excel-

0.0000334195551752625-0.00106342748862603i = -1.53938

Here is the result from the Addin-

0.0000334195551752625-0.00106342748862603i = 6.2517693806

Much thanks for your help in fixing this.

ian_jmp

Thanks once again, Gareth. The version above follows the Excel convention for calculating IMARGUMENT() values.

Recommended Articles