Jump to content
  • Advertisement
Sign in to follow this  
noNchaoTic

Matrix Class

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First of all I am not sure if this should be in general programming as it is a programming type question, but also requires a knowledge of matrices... Just wondering what methods everyone thinks should be available in a good and comprehensive matrix class. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Support for arbitrary MxN matrices, including row and column vectors; the usual matrix functions: transpose, inverse, determinant, conjugate transpose, LU factorization and inverse, addition, subtraction, multiplication, inner products, scalar multiplication, calculate eigenvalues and orthonormal decomposition. That's probably about the minimum I would expect from a good matrix library.

Share this post


Link to post
Share on other sites
I would just add that if you want it to be a graphic targeted matrix class (that is, to use for games or similar) then you may want to provide some methods for rotation/translation/scale, Look at Point, Perspective and orthogonal projs and so on...

Share this post


Link to post
Share on other sites
What about support for conversion to and from euler angles/quaternions? Would that be something most people would expect?

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Support for arbitrary MxN matrices, including row and column vectors.


Do you mean supply seperate methods to multiply a vector a column or a row (or perahps one with a flag you can set), whats the best way of acheiving this?

Share this post


Link to post
Share on other sites
Unless you're making a matrix library I suggest you only add what you need. E.g. if you need matrix to represent transforms in 3d you'll only need 3x3 and 4x4 matrices so I would'nt make the matrix class generic. My advice is to not search for the features your matrix possibly might need in the future. Instead implement only what you need right now. This prevents the code from being cluttered with unused or unimplemented code. It prevents you from wasting energy coding something you never use.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!