Jump to content
IGNORED

Mathlab on your TI99 -> math graphics functions on TI99/4A using TML


fablug

Recommended Posts

For those who would like to plot some math function on their TI994A here a quite complete program I wrote using The Missing Link graphics features.

I looked for something similar on the TI99 but didn't find any so I decided to write it by myself.

It's quite fun if you want to help and study maths with your children using a "vintage machine"

Line 100 contains the F(X) you should change with the one you want to plot

XMIN and XMAX determine the width of the X Axis while YMIN and YMAX determine the height of Y Axis.

 

If you want to try the function I put in as an example

F(X)=SIN(X)*(X^2)

   try plot 

XMIN = -4  XMAX=4
YMIN = -4 YMAX = 4

 

Not exactly like Mathlab but.... quite similar 😁  Have fun!!

 

100 DEF F(X)=SIN(X)*(X^2)
110 REM
120 REM   **************
130 REM
140 REM   BY FABRIZIO LUGLIO USING THE MISSING LINK XB
150 REM
160 ON WARNING NEXT
170 CALL LINK("GRAFIX")
180 PRINT "  ANALYSIS OF FUNCION F(X)"
190 PRINT :"F(X) IS LOCATED AT LINE 100"
200 PRINT :"A CROSS BLINKS IN THE CORNER  IF (X,Y) IS OUT OF SCREEN" :: PRINT
205 PRINT "PRESS <SPACE> WHILE DRAWING   TO RESTART FROM HERE"
210 PRINT :: PRINT
220 PRINT "ENTER X&Y DOMAIN (MIN-MAX)" :: PRINT
230 INPUT "XMIN=":XMIN
240 INPUT "XMAX=":XMAX
250 IF(XMIN>XMAX)OR XMIN=XMAX THEN PRINT :"ERROR" :: PRINT :: GOTO 230
260 INPUT "YMIN=":YMIN
270 INPUT "YMAX=":YMAX
280 IF(YMIN>YMAX)OR YMIN=YMAX THEN PRINT :"ERROR" :: PRINT :: GOTO 260
290 CALL LINK("BITMAP")
300 CALL LINK("FONTA",1)
310 CALL LINK("CLEAR")
320 A$(0)="0042241818244200"
330 A$(1)="0808087F08080800"
340 CALL LINK("CHAR",1,A$(1))
350 CALL LINK("SPRITE",1,1,14,1,235)
360 XDELTA=(XMAX-XMIN)
370 XSTEP=XDELTA/240
380 XVALUE=XMIN
390 YDELTA=(YMAX-YMIN)
400 XOLD=0 :: YOLD=0
410 GOSUB 610 :: REM   ASSEX
420 GOSUB 710 :: REM   ASSEY
430 FOR X=-120 TO 120 STEP 1
440 XVALUE=XVALUE+XSTEP
450 Y=F(XVALUE)
460 Y=(192/YDELTA)*Y
470 XC=X+120+2
480 YC=-Y+Y0
490 IF XC<0 OR XC>240 OR YC<0 OR YC>192 THEN CALL LINK("CHAR",1,A$(ABS(ROT))) :: ROT=NOT ROT :: GOTO 520
500 IF(XOLD=0)AND(YOLD=0)THEN XOLD=XC :: YOLD=YC
510 CALL LINK("LINE",YC,XC,YOLD,XOLD)
520 YOLD=YC
530 XOLD=XC
540 CALL KEY(0,K,S) :: IF K=32 THEN 100
550 NEXT X
560 CALL SOUND(200,440,10)
570 CALL LINK("DELSPR",1)
580 CALL KEY(0,K,S)
590 IF S=0 THEN 580
600 GOTO 100
610 REM   *** ASSE X ***
620 Y0=192-(-YMIN/(YMAX-YMIN))*192
630 IF YMIN>0 OR YMAX<0 THEN CALL LINK("PRINT",110,1,STR$(XMIN)) :: CALL LINK("PRINT",110,240-6*LEN(STR$(XMAX)),STR$(XMAX)) :: RETURN
640 CALL LINK("LINE",Y0,0,Y0,240)
650 CALL LINK("LINE",Y0,240,Y0-3,237)
660 CALL LINK("LINE",Y0,240,Y0+3,237)
670 IF Y0+5>190 THEN CALL LINK("PRINT",185,6,STR$(XMIN)) :: CALL LINK("PRINT",185,240-6*LEN(STR$(XMAX)),STR$(XMAX)) :: RETURN
680 CALL LINK("PRINT",Y0+5,1,STR$(XMIN))
690 CALL LINK("PRINT",Y0+5,240-6*LEN(STR$(XMAX)),STR$(XMAX))
700 RETURN
710 REM   *** ASSE Y ***
720 XC=(-XMIN/(XMAX-XMIN))*240 :: XC=XC+1
730 IF XMIN>0 OR XMAX<0 THEN CALL LINK("PRINT",1,110,STR$(YMAX)) :: CALL LINK("PRINT",185,110,STR$(YMIN)) :: RETURN
740 CALL LINK("LINE",0,XC,192,XC)
750 CALL LINK("LINE",0,XC,3,XC-3)
760 CALL LINK("LINE",0,XC,3,XC+3)
770 CALL LINK("PRINT",1,XC+5,STR$(YMAX))
780 CALL LINK("PRINT",185,XC+5,STR$(YMIN))
790 RETURN
 

 

TML-FUNC.BAS

 

 

Edited by fablug
more info
  • Like 11
Link to comment
Share on other sites

11 hours ago, SteveB said:

Doesn't work for me ..  "Sorry!  We could not locate the item you are trying to view."

Hi @SteveB, don't know why the images were not uploaded. Sorry

I reposted them. Try now.

Thank you

 

Here they are

F(x).jpg

minmax.jpg

Edited by fablug
  • Like 2
Link to comment
Share on other sites

3 hours ago, Vorticon said:

Wonderful! I suggest however that you include the TML files on the disk image so you have a complete package.

Thank you @Vorticon it's a nice idea!! I usually work on the TML using G.E.M. package in my FinalGrom99. Can you point me at a TML disk version with a complete loader? I may try to build a disk package 🙂. Thanks

Link to comment
Share on other sites

Hi @Vorticon I made it!! 😀


Here it is! You'll find a complete disk package you can run from a standard TI EXTENDED BASIC environment.

Just put the image into DSK1 and it will load automatically

You'll find on the disk image:

F(X)TML program written for a software TML library version loaded from Disk

F(X)2023 is a version you can run from a TML version on cartridge (eg. JEWEL6)

README file with some info and examples

LOAD / INTRO / TML-LOAD  files needed to set up the TML environment into a standard XB

 

Now the program works all into graphics mode and there's an option to draw functions much faster (you can set PACE=5)
Don't panic if you see some colored bricks on the screen for few seconds during loading.

 

Enjoy! 

 

image.png.6b36b098debed3b936c6478a7b467df6.png

 

 

MATHLAB.DSK

Edited by fablug
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...