# What is it trying to do?

## Recommended Posts

Hi Guys, With this code snippet,
jacobian[index]=axis.cross(tempvec);

// J * JT jacobian = j
const real	x=jacobian[index].x;
const real	y=jacobian[index].y;
const real	z=jacobian[index].z;
const real	xy=x*y;
const real	xz=x*z;
const real	yz=y*z;

tempmat[0][0]+=x*x;
tempmat[0][1]+=xy;
tempmat[0][2]+=xz;

tempmat[1][0]+=xy;
tempmat[1][1]+=y*y;
tempmat[1][2]+=yz;

tempmat[2][0]+=xz;
tempmat[2][1]+=yz;
tempmat[2][2]+=z*z;

I'd like to know what this code is doing? A matrix multiplied by its transpose? And why? x*x xy xz xy y*y yz xz yz z*z Thanks in advance Jack

##### Share on other sites
You'll do this sort of thing alot when you are calculating the inverse kinematics of a system. Check out: http://math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf

##### Share on other sites
Quote:
 Original post by mmakrzemYou'll do this sort of thing alot when you are calculating the inverse kinematics of a system. Check out: http://math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf

Sorry, my english is bad, so there was a misunderstanding here.
I'd like to know if the code snippet is doing a multiplication of a matrix with its transpose..
Thanks :)
Jack

##### Share on other sites
That matrix formed by x y and z is the product of (x y z) as a column with (x y z) as a row. In that sense, it is the product of a matrix with its transpose.

##### Share on other sites
You can see it as a tensor product( actually it is ), that is to say, the multiplication of a vector by its transpose:

A = v * transpose( v ) ( A is a 3x3 matrix and v a column vector, that is to say, a 3x1 matrix )

or

A = transpose( v ) * v ( A is a 3x3 matrix and v a row vector, that is to say, a 1x3 matrix )

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628367
• Total Posts
2982278

• 10
• 9
• 13
• 24
• 11