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

Hat Program for Nspire CX II CAS

14 views
Skip to first unread message

Tom Lake

unread,
May 20, 2019, 6:33:47 PM5/20/19
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
0 new messages