# Rotation matrix

Dear support,

I am trying to acquire the coordinates of some bony landmarks of the femur and tibia. In the code they are defined in the global reference frame of the leg but I would like them in the ISB coordinate system. Luckily the rotation matrix for the ISB coordinate systems is given as well.

The problem arose when I used this rotation matrix to produce the ISB coordinates of the landmarks. The femoral epicondyles should lie on the plane spanned by the y- and z-axis of the ISB coordinate system. However this is not the case. Also the x- and z-axis seem to be interchanged.

This moved me to the definition of the rotation matrix, especially the RotMat function where three points are used as input. Via my supervisor I got an source where a similar function was used. I adapted it to the description given in the reference manual of AnyBody.
The result is a rotation matrix equal to that computed by AnyBody if it is first transposed and multiplied by minus one.

With my own definition of the RotMat function I managed to get coordinates that are more credible but still not entirely as they should be according to the ISB standard. For this I used the updated value of the medial femoral epicondyle instead of the standard which is not updated after running the initial conditions.

I included a PDF with my findings, this includes the formula I thought the RotMat function would be.

So to summarize;

• I think the wrong third point is used in the RotMat function to define the ISB coordinate system.
• I would like to know what this RotMat function looks like when using the three point coordinates.

Yours sincerely,
Erik

Hi Erik,

You are right the femur ISB coordinate system is not defined correctly. Thank you for finding the error, we will correct it for the next release. We always apreciate input from the users that help us improve the model.

The z and x axis are indeed inverted, and also the third point should the scaled one and not the standard (unscaled). You can already use this line of code for the Femur ISBCoordinateSystem node:

ARel=RotMat(.HipJoint.sRel,.EpicondylusFemorisMidPoint.sRel,.EpicondylusFemorisMedialis.sRel)RotMat(pi0.5,z)RotMat(â€¦Sign-pi*0.5,y);

That will give you the right orientation.
And to get the coordinates of the femur nodes in the ISB coordinate system use the following code:

AnyVec3 MFEisb = EpicondylusFemorisMedialis.sRel*ISBCoordinateSystem.ARel;

Best regards, Sylvain.