- #1
helloearthling
- 2
- 0
Hi there all,
I have a personal project I'm working on and since I haven't done any linear algebra in many years I'm not sure what I think is right, is right.
I'm also not entirely sure this is the right place to ask but I'm asking more for confirmation/clarification of methodology than any solving so I think this board is more appropriate than the homework one.
So here goes
I have the following:
1. The global location of node (let's call it C). Let this be: [itex]X_{C},Y_{C},Z_{C}[/itex]
2. The global rotation of C (by global rotation I mean the rotation of the node as if the global origin were shifted to the centre of the node - does this have a specific term? I hope that made sense)
Let's call the X,Y,Z rotations of C [itex]\gamma[/itex],[itex]\beta[/itex],[itex]\alpha[/itex] respectively
3. a point (let's call it B) exists with a known offset in the local X,Y,Z directions. Let's call these offset values: XL,YL,ZL from C. What I mean by L is that if C is rotated in the X,Y,Z then C has a new local axis and the offset occurs in that direction.
So what I want to find is:
The global location and rotation of B given the above.
What I've done but am just not sure if it's right:
I have a relative rotation matrix solved by doing CR = [itex]Z \times Y \times X[/itex] rotations
which is
$$\textbf{C}_{R}=
\begin{bmatrix}
cos( \alpha) & -sin( \alpha) & 0 \\ sin( \alpha) & cos(\alpha) & 0 \\ 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
cos(\beta) & 0 & sin(\beta) \\ 0 & 1 & 0 \\ -sin(\beta) & 0 & cos(\beta)
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) \\ 0 & sin(\gamma) & cos(\gamma)
\end{bmatrix}
$$
(is this in itself right? Am I correct to label it CR ?)
And then I do, to find the Global position of B
$$\textbf{C}_{R}
\begin{bmatrix}
\gamma_{B}\\\beta_{B}\\\alpha_{B}
\end{bmatrix}=
\begin{bmatrix}
X_{C}\\Y_{C}\\Z_{C}
\end{bmatrix}$$
, solve for
\begin{bmatrix}
\gamma_{B}\\\beta_{B}\\\alpha_{B}
\end{bmatrix}
and to that answer, add
\begin{bmatrix}
X_{L}\\Y_{L}\\Z_{L}
\end{bmatrix}
Is this even correct?
Also, how does one determine the global rotation of B based off the rotation of C and the offset of B. Is it just "the same"? I think I'm overcomplicating thing but I'm honestly not sure.
In addition to the above, how does one determine the global rotation of B based off the rotation of C with additional rotational offsets of C relative to B
I hope that all made sense.
regards,
I have a personal project I'm working on and since I haven't done any linear algebra in many years I'm not sure what I think is right, is right.
I'm also not entirely sure this is the right place to ask but I'm asking more for confirmation/clarification of methodology than any solving so I think this board is more appropriate than the homework one.
So here goes
I have the following:
1. The global location of node (let's call it C). Let this be: [itex]X_{C},Y_{C},Z_{C}[/itex]
2. The global rotation of C (by global rotation I mean the rotation of the node as if the global origin were shifted to the centre of the node - does this have a specific term? I hope that made sense)
Let's call the X,Y,Z rotations of C [itex]\gamma[/itex],[itex]\beta[/itex],[itex]\alpha[/itex] respectively
3. a point (let's call it B) exists with a known offset in the local X,Y,Z directions. Let's call these offset values: XL,YL,ZL from C. What I mean by L is that if C is rotated in the X,Y,Z then C has a new local axis and the offset occurs in that direction.
So what I want to find is:
The global location and rotation of B given the above.
What I've done but am just not sure if it's right:
I have a relative rotation matrix solved by doing CR = [itex]Z \times Y \times X[/itex] rotations
which is
$$\textbf{C}_{R}=
\begin{bmatrix}
cos( \alpha) & -sin( \alpha) & 0 \\ sin( \alpha) & cos(\alpha) & 0 \\ 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
cos(\beta) & 0 & sin(\beta) \\ 0 & 1 & 0 \\ -sin(\beta) & 0 & cos(\beta)
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\ 0 & cos(\gamma) & -sin(\gamma) \\ 0 & sin(\gamma) & cos(\gamma)
\end{bmatrix}
$$
(is this in itself right? Am I correct to label it CR ?)
And then I do, to find the Global position of B
$$\textbf{C}_{R}
\begin{bmatrix}
\gamma_{B}\\\beta_{B}\\\alpha_{B}
\end{bmatrix}=
\begin{bmatrix}
X_{C}\\Y_{C}\\Z_{C}
\end{bmatrix}$$
, solve for
\begin{bmatrix}
\gamma_{B}\\\beta_{B}\\\alpha_{B}
\end{bmatrix}
and to that answer, add
\begin{bmatrix}
X_{L}\\Y_{L}\\Z_{L}
\end{bmatrix}
Is this even correct?
Also, how does one determine the global rotation of B based off the rotation of C and the offset of B. Is it just "the same"? I think I'm overcomplicating thing but I'm honestly not sure.
In addition to the above, how does one determine the global rotation of B based off the rotation of C with additional rotational offsets of C relative to B
I hope that all made sense.
regards,