Motion of Reference Frames wrt each other

1. Jun 20, 2013

srjoglekar246

I am currently working on a Python script to simulate motion of reference frames wrt each other, and I need some help with the math.

Here is the problem statement-

Suppose I have a frame A
A frame B
frame B's origin has pos-vector PB,A (function of time) wrt A in frame A
frame B is oriented at angle τ (function of time) wrt Some axis of A (Call it ψ )-I have the dcm for this transformation

Now, I have these two things-
1) Basis vectors of B
2) a pos vector (x, y, z) in B

How do I map the above 2 to frame A? As in, the math of the complete transformation

2. Jun 20, 2013

Andrew Mason

If A is an inertial reference frame then B is non-inertial - it is rotating.

To translate the position in B to A's coordinate system you would just add the displacement of the origin of B from the origin of A and then rotate:

Letting the displacement of the origin of B in A's reference frame at a given time be (xb,yb,zb), and the angle of B's x and y axes relative to those in A be τ (i.e. their z axes point in the same direction) a vector x,y,z in B would map to x',y',z' in A as follows:

(xcos(τ)+ysin(τ),ycos(τ)-xsin(τ),z) - (xb,yb,zb) = (x',y',z')

In matrix/vector notation this would be:

$$\left[ \begin{array}{ccc} cos\tau & sin\tau & 0 \\ -sin\tau & cos\tau & 0 \\ 0 & 0 & 1 \end{array} \right] \times \left[ \begin{array}{c} x\\ y\\ z \end{array} \right] - \left[ \begin{array}{c} x_b\\ y_b\\ z_b \end{array} \right] = \left[ \begin{array}{c} x'\\ y'\\ z' \end{array} \right]$$

AM

3. Jun 20, 2013

Staff: Mentor

Simply put your basis vectors (1) into a matrix, M, where the first column is the first basis vector, the second column is the second, and so forth. That should be an orthonormal matrix with determinant = 1 and represents the rotation. Then put your position vector (2) into a vector b and your transformation is Mx+b.

The order of operations is important, so I am assuming that you do the rotation first and then the translation. If you have it the other way then it is M(x+b). Each of those will map the same set of coordinate transformations, but just using different M and b.

4. Jun 20, 2013

D H

Staff Emeritus
You can find lots of material on this topic on the web. You just have to know the right search terms. This combination of translation and rotation in three dimensional space goes by a special name. It is the Euclidean group E(3). So there's your search term, "Euclidean group".

Since this is a concept from group theory the mathematics is inevitably going to be a bit tense. And a bit terse. Sometimes I think a mathematicians true joy is writing about something useful in a way that is completely incomprehensible and that goes out of its to avoid any mention of utility.

They also tend to avoid issues with representation. You are trying to write a program, so those representation issues are rather prominent. The answer to your question depends on how you represent things. The two key representation issues here you use vectors and your direction cosing matrix.
• Do you see your vectors as being row vectors or column vectors?
Row vectors transform via $x' = xT$, column vectors via $x'=Tx$. Most people use column vectors, but this choice is arbitrary. Both are valid approaches. If you use column vectors and you run across someone else who uses row vectors, it's best not to get into an argument over who is right and who is wrong.

• Do you see your direction cosine matrix as representing a physical rotation of the basis vectors in frame A toward the basis vectors in frame B, or as a means of transforming vectors in frame A to their equivalent representation in frame B?
Both interpretations can be represented as a matrix, and there's no way to distinguish which is which just by looking at the matrix. The two interpretations are conjugate to one another. I distinguish the two concepts as rotation versus transformation. Wikipedia and others uses the terms passive transformation and active transformation, which I find to be a bit incommunicative.

I'm going to assume you are using column vectors (as opposed to row vectors) and transformation matrices (as opposed to rotation vectors). Your frame B is represented by the transformation matrix TA→B and the position vector PB,A.

Suppose you have the displacement vector from the origin of frame A to some point x as represented in frame A. Call this Px,A, the representation of point x in frame A. The representation of that point x in frame B is then Px,B = TA→B(Px,A - PB,A).

Your second question essentially asks how to perform the inverse operation. The inverse of a transformation matrix (or a rotation matrix) is simply the transpose of that matrix. Thus given Px,B one calculates Px,A via Px,A = TTA→BPx,B + PB,A.

The first question, how to get the basis vectors, is easy. One way is to pre-multiply the basis vectors (e.g., (1,0,0)) by the transpose of the transformation matrix. There's an even easier way, however. You can view the transformation matrix as three column vectors stacked side-by-side or as three row vectors stacked one atop another. Given a transformation matrix TA→B, those three column vectors that collectively form TA→B are the basis vectors of frame B as represented in frame A. Similarly, the three row vectors that collectively form TA→B are the basis vectors of frame A as represented in frame B. Simply read off the desired column or row vector from the matrix and voila! you have your basis vector.

5. Jun 21, 2013

srjoglekar246

Ok, Thanks for the quick replies :-).
Another doubt.
I know the traditional formula for finding the time derivative of a vector expressed in a certain frame B in frame A. Where frame B is rotating wrt A.

(dv/dt)A = (dv/dt)B + ΩB/A X v

Now, how do I use this formula, when-
1. v isnt just any vector, but a vector field. As in, the coordinate variables of B - xB, yB, zB also appear in it? They will be functions of time wrt frame A right? Will that affect the above formula?

2. How do I now find the nth derivative of this vector field v in A?

6. Jun 21, 2013

Andrew Mason

This is rather confused.

The time derivative of a displacement is velocity. The time derivative of velocity is acceleration. You appear to be trying to find acceleration.

I have no idea what ΩB/A X v is.

This is very confused. This is not what you were asking initially. Perhaps it would be better if you just told us what it is you are trying to do.

AM

7. Jun 21, 2013

D H

Staff Emeritus
Not really. Here v is an arbitrary vector. (To avoid confusion, I tend to use $\vec q$ as opposed to v, where $\vec q$ is any arbitrary vector quantity in ℝ3.)

The cited result is special to SE(3), the three dimensional special Euclidean group. The general expression for SE(n) would involve an NxN skew symmetric matrix (the Lie algebra of SO(n) with SO(n) represented by proper orthogonal NxN matrices) rather than the vector cross product. However, in the Newtonian limit, that vector cross product form is perfect for the three dimensional universe in which we apparently live.

That is a very good suggestion. Also, srjoglekar246, tell us a bit about your academic background. The questions you are asking is stuff you should be able to find in many books. You are, perhaps unintentionally, asking us to write a book.