Simple 3x3 matrix inverse code (C++)

后端 未结 13 2103
花落未央
花落未央 2020-12-04 19:35

What\'s the easiest way to compute a 3x3 matrix inverse?

I\'m just looking for a short code snippet that\'ll do the trick for non-singular matrices, possibly using C

13条回答
  •  一个人的身影
    2020-12-04 20:13

    Why don't you try to code it yourself? Take it as a challenge. :)

    For a 3×3 matrix


    (source: wolfram.com)

    the matrix inverse is


    (source: wolfram.com)

    I'm assuming you know what the determinant of a matrix |A| is.

    Images (c) Wolfram|Alpha and mathworld.wolfram (06-11-09, 22.06)

提交回复
热议问题