Sign in to follow this  
lucky6969b

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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by mmakrzem
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


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 this post


Link to post
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.

Does that answer your question?

Share this post


Link to post
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 )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this