Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of fractional coordinates.

I also have a rotation matrix that operates on cartesian coordinates.

Does anyone know how I could convert my rotation matrix so I can operate on the fractional coordinates?

The fractional coordinates are functions of the basis vectors a,b,c and the corresponding alpha, beta, gamma.

The following link explains how to do coordinate transformations. I'm just not sure about how to use the listed matrices to operate on the rotation matrix.

Any ideas?


share|improve this question
up vote 7 down vote accepted

Lets CF be the matrix "Fractional to Cartesian" and FC be the matrix "Cartesian to Fractional" (the ones in your Wikipedia article). Let RC be the rotation matrix and xf be a fractional vector. Then to calculate the rotation, you have to transform xf to cartesian (xc = CF * xf), rotate it (xc_rotated = RC * xc) and transform it back (xf_rotated = FC * xc_rotated). Put this together and you get

xf_rotated =  FC * RC * CF * xf

So, the matrix you are looking for is FC * RC * CF.

share|improve this answer
Hi I checked the math and everything makes sense but for some reason I end up with the exact same matrix! Any thoughts on why that might be happening? – Rodney Aug 15 '12 at 19:03
@Rodney: I suggest you use an example vector where you know where it should go through the transformation and check this step-by-step. – Doc Brown Aug 15 '12 at 19:07

Looks like you need to do:

  1. Convert Fractal Coordinates -> Cartesian Coordinates (CC1).
  2. Create a Positional Matrix (PM) from your CC1.
  3. Perform the rotation on the PM using your rotation matrix to get a Transformed Matrix (TM).
  4. Get the Cartesian Coordinates (CC2) from TM.
  5. Convert CC2 -> Fractal Coordinates.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.