Matrix Library

Can anyone give me some tips on how to design my Matrix library?
particularly how to design and code a function to set the elements in a 4*4 matrix

Comments

  • [b][red]This message was edited by gautam at 2006-10-14 4:34:54[/red][/b][hr]
    : Can anyone give me some tips on how to design my Matrix library?
    : particularly how to design and code a function to set the elements in a 4*4 matrix
    :

    First write a 4d vector class. Then in 4x4 matrix class have an array of 4d vectors of size 4. Now have a set functions which can set 4 vectors, 16 floats or an array of floats. Have an index operator(overload [] operator) so that you can get the array from the 4d vector. Have a transpose function, have an add function or operator to add two matrix, have a minus function or operator, a multiplication operator with a float/double and another matrix etc.

    You can also use an 2d array -> float array[4][4]; or a single array of size 16 -> float array[16];



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion