The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





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
Post Reply 


Messages In This Thread
draw arg of the complex Zeta function - primer - 04-16-2016 05:18 PM



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