I need this code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • greenflame

    I need this code

    I need code to compute the determinant and inverse of a matrix. for
    example the determinant and inverse of:

    [1 2 3 0]
    [4 5 6 1]
    [7 8 9 2]
    [0 1 2 3]

  • commercial

    #2
    Re: I need this code

    You need to isolate parameters first.

    that is make it valid as
    you would with paper/pencil and a brain only.



    var obj = []
    obj[0] = [1, 2, 3, 0]
    obj[1] = [4 ,5, 6, 1]
    obj[2] = [7 ,8, 9, 2]
    obj[3] = [0 ,1, 2, 3]

    Now this can bee "seen"

    -> alert( obj )

    ----------------

    determinant means exactly that
    a matrix it becomes automatically
    anything inverse can be derived

    Hope that helps STUPID






    "greenflame " <alikakakhel@ya hoo.com> wrote in message
    news:1116987437 .547473.34030@g 44g2000cwa.goog legroups.com...[color=blue]
    > I need code to compute the determinant and inverse of a matrix. for
    > example the determinant and inverse of:
    >
    > [1 2 3 0]
    > [4 5 6 1]
    > [7 8 9 2]
    > [0 1 2 3]
    >[/color]

    Comment

    • Randy Webb

      #3
      Re: I need this code

      greenflame wrote:
      [color=blue]
      > I need code to compute the determinant and inverse of a matrix.[/color]

      Then write code to do it. Then post your best attempt.
      [color=blue]
      > for example the determinant and inverse of:
      >
      > [1 2 3 0]
      > [4 5 6 1]
      > [7 8 9 2]
      > [0 1 2 3][/color]

      Looks more like your homework. Is it?

      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

      Comment

      • greenflame

        #4
        Re: I need this code

        This is for a project of mine to make a mini mathematica. I will try to
        do it but I am not sure if you all will understand the matrix math.

        Comment

        • Random

          #5
          Re: I need this code

          greenflame wrote:[color=blue]
          > This is for a project of mine to make a mini mathematica. I will try to
          > do it but I am not sure if you all will understand the matrix math.[/color]

          .... so you asked us to write the code to do the math that you don't
          think we'd understand?

          Now that I don't understand.

          Keep me posted, though. I am curious.

          Comment

          • RobG

            #6
            Re: I need this code

            greenflame wrote:[color=blue]
            > This is for a project of mine to make a mini mathematica. I will try to
            > do it but I am not sure if you all will understand the matrix math.
            >[/color]

            This link (on the Wolfram site) provides a general method for
            finding the determinant of an n_x_n matrix.

            <URL:http://mathworld.wolfr am.com/Determinant.htm l>


            The "expansion by minors" technique is explained here:

            <URL:http://mathworld.wolfr am.com/DeterminantExpa nsionbyMinors.h tml>


            No doubt you can develop a specific solution for a 4x4 matrix and
            hard-code that, or you could produce a general solution that finds the
            determinant of any size square matrix. Depending on how you wish to
            approach this, the solution will be very different.

            You will likely get more assistance if you provide an algorithm that
            you are trying to implement, that way you will get input from those
            whose forte is optimisation of JavaScript regardless of whether they
            understand the mathematics involved (and don't presume they don't).

            I played with Mathematica some years ago - had I been able to apply all
            the mathematical knowledge I have ever learned (or even stumbled
            across), I doubt that I would even have scratched the surface of its
            considerable capabilities.

            Good luck in your quest!


            --
            Rob

            Comment

            • greenflame

              #7
              Re: I need this code

              Thanks Rob I will check those sites out. And I will keep you posted.

              Comment

              Working...