(42S) Roots of Complex Numbers - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (42S) Roots of Complex Numbers (/thread-14272.html) |
(42S) Roots of Complex Numbers - Eddie W. Shore - 12-30-2019 04:47 PM The program CROOTS calculates the roots of a complex number. (a+bi)^n (n is a positive integer). The roots are determined by the formula: (a + bi)^(1/n) = r^(1/n) * e^(i * (θ + 2*k*π)/n) (k = 0, 1, 2, ... , n-1) The results are stored in matrix MATZ. The calculator is switched to Radians mode during execution. Stack when running CROOTS: Y: complex number X: n HP 42 & DM42 Program CROOTS Code:
Link to download croots.raw: https://drive.google.com/open?id=1YtxgNTAJ6OdhyQRwEXSYAPSZuiYc-RaA Example: (FIX 4 mode) Find the three roots of 5+4i. (5+4i)^(1/3) Y: 5.0000 i4.0000 X: 3 Result: 1:1=1.8102 i0.4141 1:2=-1.2637 i1.3606 1:3=-0.5464 -i1.7747 (approximately 1.8102+0.4141i, -1.2637+1.3606i, -0.5464-1.7747i) Blog link: http://edspi31415.blogspot.com/2019/12/hp-42s-dm42-complex-roots-happy-new-year.html |