home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-12-30 | 1.1 KB | 59 lines |
- ' ********
- ' SURFACES
- ' ********
- BEGIN:
- SX#=320
- SY#=256
- RATIO#=1.5
- HY#=SY#/2
- HX#=SX#/2
- S#=Sqr(2)/2
- AA#=HX#*S#
- Do
- Cls
- Print "SURFACES"
- Print
- Print "1. Z = cos(R)"
- Print
- Print "2. Z = exp(-R*R)"
- Print
- Print "3. Z = sin(R)/R"
- Print
- Print " where R = sqr(X*X + Y*Y)"
- Print
- Print "4. Z = cos(X)*cos(Y)"
- Print
- Print "5. The Monkey Saddle"
- Print
- Print "type in the number of the equation"
- Print "(0 to quit)"
- Print
- Input N
- If N=0 Then Edit
- Cls
- MAINLOOP:
- For A#=-AA# To AA#+5*S#
- _MAX#=-HY#
- BB#=AA#+A#-10*S#*Int((A#+Abs(A#))/(10*S#))
- For B#=-BB# To BB#+S#*4 Step 10*S#
- X#=S#*(A#+B#)
- Y#=S#*(B#-A#)
- Z#=B#
- R#=Sqr(X#*X#+Y#*Y#)
- If N=1 Then Z#=10*Cos(R#/5)+B#
- If N=2 Then Z#=75*Exp(-R#*R#/600)+B#
- If N=3 and R#<>0 Then Z#=125*Sin(R#/5)/R#+B#
- If N=4 Then Z#=10*Cos(X#/10)*Cos(Y#/10)+B#
- If N=5 and R#<>0 Then Z#=X#*Y#*(X#-Y#)*(X#+Y#)/(1000*R#)+B#
- If Z#<_MAX# Then Goto _NEXTLINE
- _MAX#=Z#
- U#=HX#+A#
- V#=HY#+Z#*S#/RATIO#
- If V#<0 or V#>SY# Then Goto _NEXTLINE
- Plot U#,SY#-V#
- _NEXTLINE:
- Next B#
- Next A#
- Wait Key
- Loop
- FINITO: