Post Reply 
draw arg of the complex Zeta function
04-16-2016, 05:18 PM
Post: #1
draw arg of the complex Zeta function
Hello,

This morning I decided to graph arg of Zeta function.
Let me share with you how I easily build it thanks to hpprime with few line of program.

I wanted to see how Zeta function were extended to complex numbers in HpPrime.
Idea came from a picture from this video.

Ok, let's start.
To do this, I first had to create a function that would return a color from a number from [-pi ; -pi]
this function will take the argument, and will return a color.
for that I made a small program : a2c
Code:
EXPORT a2c(A)
BEGIN
LOCAL R,G,B;
 R:=127*(SIN(A)+1);
 G:=127*(COS(A)+1);
 B:=127*(SIN(A+π)+1);
 RETURN RGB(R,G,B);
END;
and here is how R,G and B will be computed with this function :
[Image: 2cdy4pz.jpg]

Next I needed to "see" it working with the full complex plan.
Code:
EXPORT testc()
BEGIN
LOCAL M:=40,P:=100;
FOR X FROM −M TO M DO
 FOR Y FROM −M TO M DO
  IF X≠0 OR Y≠0 THEN
   PIXON_P(X+P+M,Y+P+M,
   a2c(ARG(X+i*Y)));
  END;
 END;
END;
FREEZE;
END;
it gives that :
[Image: wrf4pg.png]

and I just need to made few change to get the Zeta :
Code:
EXPORT testz()
BEGIN
LOCAL M:=40,P:=100,Q:=10,K;
FOR X FROM −80 TO 15 DO
 FOR Y FROM −40 TO 40 DO
   K:=approx(CAS.Zeta((X+i*Y)/Q));
   IF K≠0 THEN
   PIXON_P(X+P+M,Y+P+M,
   a2c(ARG(K)));
  END;
 END;
END;
FREEZE();
WAIT();
END;
that gives :
[Image: 21lshkw.png]
note : on real calc, it takes about 7 minute to draw it, and at the end the calc will probably switch off (depending on your TOff).

note : CK "monitor" feature does not really respect colors displayed on real calc, I had to copy programs to virtual calc to have nice screen capture.

Regards,
primer.

primer
Find all posts by this user
Quote this message in a reply
04-16-2016, 06:31 PM (This post was last modified: 04-16-2016 06:32 PM by primer.)
Post: #2
RE: draw arg of the complex Zeta function
And while testing in virtual calc, as it's fast enough,
here is a wider view :
[Image: aacexh.png]

bye.

primer
Find all posts by this user
Quote this message in a reply
04-16-2016, 08:52 PM (This post was last modified: 04-16-2016 08:53 PM by primer.)
Post: #3
RE: draw arg of the complex Zeta function
And that's also fun to try other functions,

like :
[Image: 34s5no9.png]
is arg(x^(iY))

quite fast on real hpprime, btw.

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




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