Saturday, August 5, 2017

HP Prime: abs(sqrt(z)) graph

HP Prime:  abs(sqrt(z)) graph



Marvel at the graph of complex numbers (really the magnitude of complex numbers) of the equation f = |√z|, where z = x + yi.   The graph takes place over the range of x: [-10, 10] and y: [-10, 10].  The lighter the shade, the higher the magnitude. Enjoy!

HP Prime Program MAGSQRT

EXPORT MAGSQRT()
BEGIN
// 2017-07-28 EWS
// TST4503
STARTAPP("Function");
Xmin:=−10; Xmax:=10;
Ymin:=−10; Ymax:=10;
LOCAL cx:=0.05,cy:=0.05,r,c;
LOCAL clr,b;


RECT();
FOR r FROM Xmin TO Xmax STEP cx DO
FOR c FROM Ymin TO Ymax STEP cy DO
clr:=ABS(√(r+c*i));
PIXON(r,c,RGB(60*clr,60*clr,60*clr));
END;
END;
TEXTOUT_P("ABS(√(a+bi)): [−10,10]"
,50,220);

WAIT(0);
END;

Replace the i with the complex symbol [Shift] [ 2 ].



Eddie


This blog is property of Edward Shore, 2017