|
Post by imekon on Aug 28, 2019 18:03:26 GMT
How do I calculate the cofactor of a 4x4 matrix. The test code has the following:
Then cofactor(A, 0, 0) = 690 And cofactor(A, 0, 1) = 447 And cofactor(A, 0, 2) = 210 And cofactor(A, 0, 3) = 51
There's pseudo code for 3x3 matrix but not for the 4x4 matrix - or did I misunderstand how to do it?
|
|
|
Post by totally on Sept 1, 2019 4:03:40 GMT
The cofactor function should not really care about the size of the matrix itself. It takes the row and column of interest as parameters. It does make calls to a few other functions by the end of it such as "minor", "submatrix" and "determinant" Only really "submatrix" has to know the size of the current matrix but that should be straightforward. Let me know if you want to see how I have implemented those functions.
|
|
|
Post by imekon on Sept 4, 2019 19:50:28 GMT
I've been unable to figure out how to write the cofactor routines, so if you could show your version that would be helpful!
Thanks!
|
|
|
Post by totally on Sept 5, 2019 5:33:33 GMT
|
|