Tom Lake
unread,May 20, 2019, 6:33:47 PM5/20/19You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Here's a fun little hat program for the Nspire CX II CAS. I use this program to benchmark graphics calculators.
Define hat()=
Prgm
:Local l170
:Define l170()=Prgm
: x1:=xx+zz+p
: y1:=yy-zz+q
: SetColor 0,255,0
: PlotXY x1,y1,7
: If y1≠0 Then
: SetColor 0,0,0
: DrawLine x1,y1-1,x1,0
: EndIf
:EndPrgm
:SetWindow 0,319,0,199
:FillRect 0,0,320,200
:p:=160: 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 zi,−q,q-1
: If zi≥−zp and zi≤zp Then
: zt:=((zi*xp)/(zp)): zz:=zi
: xl:=int(0.5+√(xp*xp-zt*zt))
: For xi,−xl,xl
: xt:=√(xi*xi+zt*zt)*xf: xx:=xi
: yy:=(sin(xt)+0.4*sin(3*xt))*yf
: l170()
: EndFor
: EndIf
:EndFor
:EndPrgm