(01-23-2021 06:17 PM)Benoit Morissette Wrote: January 23, 2021.
Upgraded my Casio fx-9760GIII to 3.40.3200 using the “fx-9860GIII Series OS Ver.3.40 Update.exe” file (dated: 2020-09-30). Works very well. Python is 3 times faster than Basic and includes casioplot module. I have adapted the “hat.py” for the lower screen resolution by tweaking some constants. Here it is:
Code:
from math import *
from casioplot import *
blk=(0,0,0)
wht=(255,255,255)
p=64; q=32
xp=55; xr=1.8*3.14159265358
yp=20; yr=3; zp=20
xf=xr/xp; yf=yp/yr; zf=xr/zp
for zi in range(-q,q):
if zi>=-zp and zi<=zp:
zt=zi*xp/zp; zz=zi
xl=int(.5+sqrt(xp*xp-zt*zt))
for xi in range(-xl,xl+1):
xt=sqrt(xi*xi+zt*zt)*xf; xx=xi
yy=(sin(xt)+.4*sin(3*xt))*yf
x1=int(xx+zz+p)
y1=192-int(yy-zz+q)
set_pixel(x1,y1,(0,255,0))
for m in range(y1+1,y1+10):
set_pixel(x1,m)
show_screen()
The results are beautiful and fast!
What are the variables blk and wht for? I don't see them used anywhere after being initialized.