Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Green Hat in Casio Python

7 views
Skip to first unread message

Tom Lake

unread,
Apr 8, 2020, 7:20:05 AM4/8/20
to
from math import *
from casioplot import *
def hat():
p=192; q=100
xp=144; xr=1.5*3.1415927
yp=56; yr=1; zp=64
xf=xr/xp; yf=yp/yr; zf=xr/zp
for y in range(0,192):
for x in range(0,384):
set_pixel(x,y)
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))
show_screen()
for m in range(y1+1,192):
set_pixel(x1,m)
0 new messages