Menu

Suggestions: MAT functions

Tom Lake
2014-06-18
2019-06-13
  • Tom Lake

    Tom Lake - 2014-06-18

    I'd like to see all the MAT statements and functions of ISO BASIC (INV, DET, TRN, IDN, MAT READ, MAT PRINT, etc.) Matrix manipulation makes graphics translations and rotations so much easier and, potentially faster.

     
  • Markus Hoffmann

    Markus Hoffmann - 2014-06-19

    Well, OK, lets make them work.

    There is a DET, INV, TRANS already. What is TRN, IDN supposed to do?

    Note that X11-Basic uses them as Functions for arrays, instead of MAT-commands.

     
    • Tom Lake

      Tom Lake - 2014-06-19

      IDN creates an identity matrix

      1 0 0 0
      0 1 0 0
      0 0 1 0
      0 0 0 1

      TRN is the transpose of a matrix, flipping rows and columns. I couldn't find a description of TRANS in the manual except for the first reference. Is transverse the same as transpose?

      1 2 3 1 4 7
      4 5 6 ===> 2 5 8
      7 8 9 3 6 9

       
  • Markus Hoffmann

    Markus Hoffmann - 2014-06-19

    TRANS should do the TRN thing. ITN is already implemented:

    a()=1(4)

    Maybe the sytax looks really strange, but it works.

    So what is really missing is MAT PRINT.

    MAT READ is also missing, but you can easily define Array constants like
    a()=[1,2,3,4;5,6,7,8;9,0,1,2;3,4,5,6]

    An implementation of MAT READ would be simple. I would call the new command "MATREAD" without the space. Maybe this would not even be necesaary, because an extension of the normal READ command will do:

    READ a()

    Same for PRINT:

    PRINT a()

    But how should the oputput look like?

    (depending on the dimension of the array)

    What about PRINT a() USING "##.##"

    maybe too difficult to implement.....

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.