Download x - Austromath

Transcript
p 46
Josef Böhm: Appendix to the Hidden Lines on the TI-92
D-N-L#35
The TI-programs:
create(num)
Prgm
Local j_,num,bo,pt
Request "Name of solid",nams
{}→bo
ClrIO
For j_,1,num
InputStr "Point",pt
augment(bo,expr(pt))→bo
EndFor
list▶mat(bo,3)→bo
bo→#nams
Disp "ready, press F5"
EndPrgm
hiddgen(m3,pro,f)
Prgm
ClrDraw
Local m,l,i,j,st,test,k_,fla
© Testroutine with Determinant
Define test(mm,k)=Func
(mm[k+2,1]-mm[k+1,1])*(mm[k,2]-mm[k+1,2])-(mm[k+2,2]-mm[k+1,2])*(mm[k,1]mm[k+1,1])
EndFunc
ClrIO
© Start MainProg
© Transfer 3D-Points to 2D
m3*pro→m:1→st:dim(f)[2]→fla
For k_,1,fla,1
If test(m,st)>0 Then
For i,0,f[1,k_]-1,1
Line m[st+i,1],m[st+i,2],m[st+i+1,1],m[st+i+1,2],1
EndFor
EndIf
st+f[1,k_]+1→st
EndFor
EndPrgm
For allingen(m3,pro,f) you have only to remove the hidden line test.
I add another object stairs (produced with a vector fstair).