Hi All,
I'm currently working on my project (which try to perform degree reduction for a Bezier curve).
I've spent a long time trying to find library or useful class to help me perform matrix inversion.
For example degree reduction in Bezier's curve (let's say from degree 3 to degree 2)
B2: bezier curve for degree of 2 (which is unknown in this case)
B3: bezier curve for degree of 3 (which is a given in this case)
M: A matrix involving bezier curves (I already wrote a function to get this matrix)
The fomula to find B2 is as followed:
B2 = inverse(Mtranspose * M) * M * B3
I wrote function to perform matrices multiplication and matrix transpose. I'm having a great deal of difficulty integrating TNT::JAMA_LU and other classes I've found. I just want to do an inverse of a matrix (dimension NxN)
I've spent too much time trying to figure out how to do matrix inversion and that's not even the main point of my project. I chose to use C++ because I'm using OpenGL to plot my bezier curve... and I can't seem to integrate TNT::JAMA_LU to my program. *sob*
Also... i've tried the information from (http://www.dreamincode.net/forums/showtopic43006.htm) .. and for some reason i just have NAN as my result :S Or maybe im not integrating it correctly. But.. I just copy and pasted the code. :-S
Can anyone provide me with good resources? I really appreciate any help in advance.
** additional information
My current class Matrix has the following variables:
- double* data <-- which contain the list of double values in the matrix
- rows <-- number of row in the matrix
- cols <-- number of column in matrix
current functions i have for my matrix class
- cells(int row, int col) <- will get the exact data from double* data
- declareMatrix
- getActualSize
- getCols
- getRows
- invert <--- trying to do this... but i'm stuck .. and don't know where else to go
- multiply (which takes in two matrices and return a multiplied matrix)
- transpose (do a transpose on a matrix)
- setData (can take a set of double* data and put it in a matrix of dimension NxM
I hope my problem/request is clear...
THANK YOU very much in advance for any help