Post Reply 
sqrt(1+i)
07-07-2021, 01:35 PM (This post was last modified: 07-07-2021 01:36 PM by roadrunner.)
Post: #20
RE: sqrt(1+i)
(07-04-2021 03:50 PM)Albert Chan Wrote:  Code is wrong. Think polar form (cis(θ) = cos(θ) + i*sin(θ))

That works a lot better. Revision B of rootroot:

Code:
#pragma mode( separator(.,;) integer(h32) )

rootroot(a,n);

#cas

rootroot(a,n):=
BEGIN
 n:=trunc(n);
 if n<=0 then return undef; end;
 csqrt:=√((abs(a)+re(a))/2)+sign(im(a))*i*√((abs(a)-re(a))/2);
 if n==1 then return csqrt; end;
 return rootroot(csqrt,n-1);
END;

#end

Thank you sir!

-road
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
sqrt(1+i) - moonbeam - 09-26-2016, 12:35 PM
RE: sqrt(1+i) - parisse - 09-26-2016, 06:19 PM
RE: sqrt(1+i) - Helge Gabert - 09-26-2016, 08:33 PM
RE: sqrt(1+i) - dg1969 - 09-26-2016, 08:38 PM
RE: sqrt(1+i) - Helge Gabert - 09-27-2016, 04:19 AM
RE: sqrt(1+i) - Helge Gabert - 10-04-2016, 03:06 PM
RE: sqrt(1+i) - Helge Gabert - 10-04-2016, 04:50 PM
RE: sqrt(1+i) - roadrunner - 10-05-2016, 12:16 PM
RE: sqrt(1+i) - Albert Chan - 07-04-2021, 03:50 PM
RE: sqrt(1+i) - roadrunner - 07-07-2021 01:35 PM
RE: sqrt(1+i) - parisse - 10-05-2016, 01:52 PM
RE: sqrt(1+i) - DedeBarre - 10-05-2016, 05:54 PM
RE: sqrt(1+i) - Hlib - 07-05-2021, 05:31 PM



User(s) browsing this thread: 1 Guest(s)