No Karel or Vision Tools? Now introducing Matrix Math in TP!

    • New
    • Helpful

    I've implemented the Karel programs MATRIX and INVERSE in TP. Downside is you have to sacrifice a user frame for it to work. I picked 9.


    In the karel programs you would call it like so:

    Code
    : CALL MATRIX(89,90,91) ;

    Where PR[91]=PR[89]*PR[90].


    The TP Program functions the same way, except for the name.

    Code
    : CALL MMULT(89,90,91) ;


    Same deal for inverse. Karel version is called like this:

    Code
    : CALL INVERSE(89,90) ;

    Where PR[90]=PR[89]'.


    The TP Program functions the same way, except for the name.

    Code
    : CALL MINV(89,90) ;


    Here is the TP matrix multiply program:


    And here is the TP inverse program:


    Also attached is a .zip file of the .TP and .LS files. TP is compiled on V9.30 HandlingTool.


    Limitations/Caveats:

    • Frame 9 is used to do conversions. If you are using frame 9, modify the top and bottom of each program to use a frame that is free on your system. Also, label it as "RESERVED" or something like that.
    • Not sure if it works on JPOS rep points.
    • All index arguments must be unique. The programs use the result as a working area for calculations, and would screw up the math.
      • Don't do something like this: CALL MINV(90,90)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now