cnCalc计算器论坛

 找回密码
 注册
搜索
查看: 5829|回复: 6

[Nspire] 图像 程序

[复制链接]
发表于 2012-10-2 20:41:26 | 显示全部楼层 |阅读模式
怎样在写一个程序,画出图像
发表于 2012-10-2 20:49:05 | 显示全部楼层
请标明机型,或是平台
发表于 2012-10-2 20:51:56 | 显示全部楼层
给你一段画函数图像的程序
  1. 1 " "GOTO 10
  2. 2 Y=0:REM ----+----+----+----+----+----+----+----+----+----+----+----+----+----+--
  3. 3 RETURN
  4. 10 LOCK :CLEAR :DIM A$(1)*73:ON ERROR GOTO 500
  5. 11 CLS :PAUSE " PLANAR CARTESIAN PLOTTER":PAUSE "  Copr. 1982 Tandy Corp."
  6. 20 "C"CLS :WAIT 0:PRINT "  Fn  Plt Dsp End"
  7. 21 Z=ASC INKEY$ -16:IF Z<1OR Z>4THEN 21
  8. 22 CLS :GOTO 100*Z
  9. 100 M=STATUS 2-STATUS 1+16:INPUT "F(X)=";A$(0):CLS :A$(1)=A$(0)
  10. 110 RESTORE 901:IF A$(0)=""POKE M,58,&F1,&AB:GOTO 20
  11. 120 Z=ASC A$(0):IF Z<65OR Z>84THEN 160
  12. 130 FOR I=1TO 17:READ T$,Z:IF LEFT$ (A$(0),LEN T$)<>T$NEXT I:GOTO 160
  13. 140 I=17:NEXT I:POKE M,&F1,Z:M=M+2
  14. 150 PRINT T$;:G=LEN A$(0):H=LEN T$:A$(0)=RIGHT$ (A$(0),G-H):GOTO 110
  15. 160 Z=ASC A$(0):IF Z>32POKE M,Z:M=M+1
  16. 170 T$=CHR$ Z:GOTO 150
  17. 200 RESTORE 900:FOR I=1TO 6:READ P$:CLS :PRINT P$;" =";@(I);:INPUT "? ";@(I)
  18. 201 NEXT I:CLS
  19. 202 IF E>0AND E<101AND E=INT ETHEN 210
  20. 203 CLS :INPUT "Reenter step, 1-100 ";E
  21. 204 GOTO 202
  22. 210 GRAPH :GLCURSOR (0,-250):SORGN
  23. 211 LINE (0,0)-(216,200),,,B
  24. 212 FOR Y=0TO 195STEP 195:FOR Z=22TO 194STEP 22:LINE (Z,Y)-(Z,Y+5):NEXT Z:NEXT Y
  25. 213 FOR Y=0TO 211STEP 211:FOR Z=20TO 180STEP 20:LINE (Y,Z)-(Y+5,Z):NEXT Z:NEXT Y
  26. 220 FOR I=0TO 100STEP E:X=A+.01*I*(B-A):GOSUB 250:IF ILINE (K,L)-(M,N),0
  27. 221 K=M:L=N:NEXT I
  28. 230 GLCURSOR (0,-30):TEXT :CSIZE 1:LPRINT "F(X)=";A$(1):LF 1:RESTORE 900:FOR I=1TO 6:READ P$:LPRINT P$;" =";@(I)
  29. 231 NEXT I:LF 7:GOTO 20
  30. 250 GOSUB 2
  31. 251 IF Y<CLET Y=C
  32. 252 IF Y>DLET Y=D
  33. 253 M=216*(X-A)/(B-A)
  34. 254 N=200*(Y-C)/(D-C)
  35. 255 RETURN
  36. 300 WAIT :PRINT "F(X)=";A$(1):WAIT 0:GOTO 20
  37. 400 UNLOCK :END
  38. 500 V=STATUS 4:W=PEEK &789B:IF V=2BEEP 1:Y=E:GOTO 251
  39. 510 WAIT :PRINT "ERROR";W;" in";V:GOTO 20
  40. 900 DATA "XL","XH","YL","YH","Step %","F(error)"
  41. 901 DATA "SQR",&6B,"SIN",&7D,"COS",&7E,"TAN",&7F,"LN",&76,"LOG",&77,"EXP",&78
  42. 902 DATA "PI",&5D,"ABS",&70,"ASN",&73,"ACS",&74,"ATN",&75,"INT",&71,"SGN",&79
  43. 903 DATA "OR",&51,"AND",&50,"NOT",&6D
  44. 999 END
复制代码
发表于 2012-10-4 13:38:21 | 显示全部楼层
什么平台.......话说我试了一下英文翻译,准确度给跪下了.......特别是LZ的ID,真的给翻译出来了.
发表于 2012-10-5 18:02:29 | 显示全部楼层
3L你还不如用gdip
 楼主| 发表于 2012-10-5 19:45:17 | 显示全部楼层
sorry,是TI NSPIRE CX CAS
发表于 2012-10-6 19:09:01 | 显示全部楼层
在Graph里定义几个对应法则为undef的函数就可以了,要不就用散点图连线
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cnCalc计算器论坛

GMT+8, 2024-12-31 00:50 , Processed in 0.068855 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表