# How to convert lab frame quaternions and plane normal to misorientation quaternion and crystal plane normal for grain boundaries?

### Background

Let qA and qB represent unit, orientation quaternions of grain A and grain B of a grain boundary in the lab reference frame, respectively. Let qm be the misorientation quaternion of qA and qB. Quaternion inversion (qinv) and quaternion multiplication (qmult) are discussed in Quaternions and spatial rotations. Let mA be the boundary plane normal pointing from grain A to grain B in the sample reference frame. Let nA be the boundary plane normal pointing outwards from grain A towards grain B in the grain A crystal reference frame. All boundary planes are represented in 3D Cartesian coordinates.

qinv(qA) = [qA(1) -qA(2:4)]
qinv(qB) = [qB(1) -qB(2:4)]

qmult(qA,qB) ~= qmult(qB,qA) %non-commutative


### My Understanding

I think the misorientation quaternion is obtained by one of the following two conversions:

1. qm = qmult(qinv(qA),qB);
2. qm = qmult(qB,qinv(qA));

I think the boundary plane normal is represented by:

nA = qmult(qA,qmult([0 mA],qinv(qA)));
nA = nA(2:4); %drop 1st element which is 0


While the two misorientation quaternions share the same misorientation angle, they each represent rotations around different axes, and thus (as far as I understand), a different grain boundary.

### Question

What is the appropriate conversion of (qA, qB, mA) triplets to (qm, nA) pairs?

### References

• +1. Welcome to our community and thank you so much for contributing your question here!! We hope to see much more of you here !!! Sep 23 '20 at 18:47
• If there's a more appropriate stack exchange for this question, happy to hear suggestions. Nov 11 '20 at 21:47
• I've posted it here and here. One room is specifically for MATLAB and the other specifically for Physics. I worry that it still won't be enough. I don't know a lot of people that work a lot with quaternions. Many mathematicians know what they are, but I think might be unlikely to answer a question about grain-boundaries or crystallography. Perhaps you can explain in the above two chat rooms, some more details about what you want? Nov 14 '20 at 1:37
• Hi Sterling, I added some code blocks to improve the formatting a bit, and this will have the positive effect of bumping the question up to the top so that more users can see it (now that we have a lot more users than when you first asked this question). I have a question: What exactly is the reference for? Typically a reference list would be added when there's in-line citations to the items in the reference list, as in this case. Jun 22 at 0:44