tags:

views:

626

answers:

2

hi,

I have a number of 3x3 matricess that I want to multiply together For example:

m1*m2*m3*m4*m5

Although MTL is a recommended way, I don't have this library and can't use it.

Can someone please suggest a conventional way to multiply these 3x3 matrices (all matrices m1 to m5). Code snippet (for matrix multiplication and multiplying n matrices together) or pointer to some online code will be very useful

A: 

This site has code for multiplying two 3x3 matrices together: http://www.euclideanspace.com/maths/algebra/matrix/resources/code/index.htm#mul3.

Kyle Lutz
A: 

Here is a package of very useful math routines including 3x3 matrix multiplication. The C++ template classes are implemented as header files that can be simply dropped into a project. The overloaded operators make code using this package look very clean. You can preview the implementation of the 3D vector template class online.

Here is a list of all the files in the archive, with those specific for 3x3 matrix multiplication highlighted in bold:

  • Assert.c
  • Assert.h
  • intersect.cpp
  • intersect.h
  • line2.h
  • Line3.h
  • main.cpp
  • Math.dsp
  • Math.dsw
  • Matrix2.h
  • Matrix3.h
  • matrix4.h
  • MatrixN.h
  • plane.h
  • quaternion.h
  • random.h
  • Rect.h
  • Spline.cpp
  • Spline.h
  • Utility.h
  • vector2.h
  • vector3.h
  • vector4.h
Leftium