- #1
yetar
- 54
- 0
I am having a hard time figuring this out.
Suppose we have a 4x4 matrix A, B and rotation matrix D.
Matrix A represent position and orinetation of object1, matrix B represent position and orientation of object2. Matrix D is the position and oreintation of object2 relative to object1.
B = D*A
D is a constraint on object1 and object2, meaning when B=D*A, then the two objects are in rest position relative to each other.
If the the position of object2 is L relative to object1, I want to fix their position so, B*A^(-1) = D, they will keep the rest position.
This can be done by doing B' = D*L^(-1)*B,
Since B = L*A.
However, I do not want only to move B, but I would rather want to move both A and B the same distance and orientation, each one half way through, so the result of this movement will be so that B*A^(-1) = D
This can be done this way:
E = D*L^(-1)
B' = (E^0.5)*B
A' = D^(-1)*(E^0.5)*B
Now the big problem is this:
How do I calculare E^0.5?
First of all, E is not an exact rotation matrix because it is a 4x4 matrix and the 4th row is a "translation vector".
But even if I have a 3x3 matrix, it is hard to calculate the square root of this matrix.
Lets look on a 3x3 rotational matrix.
In order to calculate the square root of it, we need a eigen decomposition of this matrix. After doing that, we take the square root of each component of the diagonal part of the eigen decomposition, we multiply by the matrix and its inverse matrix that are made of the eigen vectors as columns and we get the square root of the rotation matrix.
But how do I find the eigen vectors and eigen values of the matrix? given it is a rotational matrix.
I need some algorithm to calculate those, so I can calculate the square root of the matrix.
Also, I was told that there are infinent solution of a reference point is not given?
But it is a square root, so there should be only two solutions?
I would greatly appreciate help on this matter, I have been trying to solve this the whole day.
Suppose we have a 4x4 matrix A, B and rotation matrix D.
Matrix A represent position and orinetation of object1, matrix B represent position and orientation of object2. Matrix D is the position and oreintation of object2 relative to object1.
B = D*A
D is a constraint on object1 and object2, meaning when B=D*A, then the two objects are in rest position relative to each other.
If the the position of object2 is L relative to object1, I want to fix their position so, B*A^(-1) = D, they will keep the rest position.
This can be done by doing B' = D*L^(-1)*B,
Since B = L*A.
However, I do not want only to move B, but I would rather want to move both A and B the same distance and orientation, each one half way through, so the result of this movement will be so that B*A^(-1) = D
This can be done this way:
E = D*L^(-1)
B' = (E^0.5)*B
A' = D^(-1)*(E^0.5)*B
Now the big problem is this:
How do I calculare E^0.5?
First of all, E is not an exact rotation matrix because it is a 4x4 matrix and the 4th row is a "translation vector".
But even if I have a 3x3 matrix, it is hard to calculate the square root of this matrix.
Lets look on a 3x3 rotational matrix.
In order to calculate the square root of it, we need a eigen decomposition of this matrix. After doing that, we take the square root of each component of the diagonal part of the eigen decomposition, we multiply by the matrix and its inverse matrix that are made of the eigen vectors as columns and we get the square root of the rotation matrix.
But how do I find the eigen vectors and eigen values of the matrix? given it is a rotational matrix.
I need some algorithm to calculate those, so I can calculate the square root of the matrix.
Also, I was told that there are infinent solution of a reference point is not given?
But it is a square root, so there should be only two solutions?
I would greatly appreciate help on this matter, I have been trying to solve this the whole day.