<p>I'm not going to dive into much details about affine transformations and such, you are better off reading up on these concepts from good graphics books.</p>

<p>I think The matrix you need is this. </p>

<p><span class="math-container">$\begin{bmatrix}
0.5 &amp; 0 &amp; 0 &amp; 4\\
0 &amp; 0.5 &amp; 0 &amp; 6\\
0 &amp; 0 &amp; 0.5 &amp; 2\\
0 &amp; 0 &amp; 0 &amp; 1\\
\end{bmatrix}$</span></p>

<p>The reason why we need 4x4 matrices is because of affine transformations. For more details on why we have 4x4 matrices and why are we using 4D representation you can check my answer <a href="https://computergraphics.stackexchange.com/questions/6271/what-is-the-use-of-homogenous-divide/6275#6275">here</a>. Briefly speaking, Vectors representing direction have an extra <code>0</code> at the end since translations don't affect these sort of vectors and Vectors representing points have an extra <code>1</code> at the end. This makes our vectors 4D so we can apply 4x4 transformation matrices. Since here we are concerned with points we will append an extra <code>1</code> to each vectors.</p>

<p>Let's begin by how did I derive it. First of all we can see that they provided the origin of the <span class="math-container">$UVW$</span> frame in terms of <span class="math-container">$IJK$</span> frame. This is <span class="math-container">$[4i, 6j, 2k]$</span>. In other words the vector <span class="math-container">$[0,0,0]$</span> in <span class="math-container">$UVW$</span> frame must correspond to <span class="math-container">$[4i, 6j, 2k]$</span> in <span class="math-container">$IJK$</span> frame. Let's forget the 0.5's in the diagonal for now. We have,</p>

<p><span class="math-container">$\begin{bmatrix}
0 &amp; 0 &amp; 0 &amp; 4\\
0 &amp; 0 &amp; 0 &amp; 6\\
0 &amp; 0 &amp; 0 &amp; 2\\
0 &amp; 0 &amp; 0 &amp; 1\\
\end{bmatrix}
* 
\begin{bmatrix}
0\\
0\\
0\\
1\\
\end{bmatrix}
=
\begin{bmatrix}
4\\
6\\
2\\
1\\
\end{bmatrix} $</span></p>

<p>Next the condition is if we move 1 unit in <span class="math-container">$IJK$</span> we move 2 units in <span class="math-container">$UVW$</span> or in other words if we move 1 unit in <span class="math-container">$UVW$</span> we move 0.5 units in <span class="math-container">$IJK$</span>. This means if we move from origin to <span class="math-container">$[1,1,1]$</span> in <span class="math-container">$UVW$</span> we moved half a unit in the <span class="math-container">$IJK$</span> frame in each of the axis. Testing the original matrix now we have,</p>

<p><span class="math-container">$\begin{bmatrix}
0.5 &amp; 0 &amp; 0 &amp; 4\\
0 &amp; 0.5 &amp; 0 &amp; 6\\
0 &amp; 0 &amp; 0.5 &amp; 2\\
0 &amp; 0 &amp; 0 &amp; 1\\
\end{bmatrix}
* 
\begin{bmatrix}
1\\
1\\
1\\
1\\
\end{bmatrix}
=
\begin{bmatrix}
4.5\\
6.5\\
2.5\\
1\\
\end{bmatrix} $</span></p>

<p>When constructing matrices this way, you want the translation factor in the last column. This factor is given to you by telling you the origin of the <span class="math-container">$UVW$</span> frame in terms of <span class="math-container">$IJK$</span> frame. This means the <span class="math-container">$UVW$</span> frame is that much displaced/translated when viewed from <span class="math-container">$IJK$</span> frame.</p>

<p>Secondly any scaling factor goes along the diagonal like above. This factor was given to you by telling you "If you move <span class="math-container">$X$</span> units in 1 frame, you move <span class="math-container">$Y$</span> units in the other".
Which is what we want I guess. Is that what you need?</p>

CC BY-SA 4.0
2018-10-10T10:21:22.357Z
2018-10-10T10:21:22.357Z
gallickgunner
<p>If I had two right handed frames where one has vectors [i, j, k] and another with corresponding vectors [u v w], how would I derive the transform M[i j k] &lt;-- [u v w] when applied to any point P in [u v w] we get its representation in [i j k] ?</p>

<p>They noted that for every unit we move in the [i j k] frame we move 2 units in the [u v w] frame and the origin of the [u v w] frame can be represented as [4i 6j 2k]</p>

<p>Can someone help me derive this? I'm fairly new to computer graphics and need some help in detail.</p>

<transformations><vectors>
How do I derive this transformation
Ray
# How do I derive this transformation

(Asked by: username_0 on 2018-10-10)

If I had two right handed frames where one has vectors [i, j, k] and another with corresponding vectors [u v w], how would I derive the transform M[i j k] <-- [u v w] when applied to any point P in [u v w] we get its representation in [i j k] ?

They noted that for every unit we move in the [i j k] frame we move 2 units in the [u v w] frame and the origin of the [u v w] frame can be represented as [4i 6j 2k]

Can someone help me derive this? I'm fairly new to computer graphics and need some help in detail.

**Tags:** transformations, vectors


---

## 1 answers

### Answer by username_1 on 2018-10-10. Score: 1

I'm not going to dive into much details about affine transformations and such, you are better off reading up on these concepts from good graphics books.

I think The matrix you need is this.

$\begin{bmatrix}
0.5 & 0 & 0 & 4\\
0 & 0.5 & 0 & 6\\
0 & 0 & 0.5 & 2\\
0 & 0 & 0 & 1\\
\end{bmatrix}$

The reason why we need 4x4 matrices is because of affine transformations. For more details on why we have 4x4 matrices and why are we using 4D representation you can check my answer [here](https://computergraphics.stackexchange.com/questions/6271/what-is-the-use-of-homogenous-divide/6275#6275). Briefly speaking, Vectors representing direction have an extra `0` at the end since translations don't affect these sort of vectors and Vectors representing points have an extra `1` at the end. This makes our vectors 4D so we can apply 4x4 transformation matrices. Since here we are concerned with points we will append an extra `1` to each vectors.

Let's begin by how did I derive it. First of all we can see that they provided the origin of the $UVW$ frame in terms of $IJK$ frame. This is $[4i, 6j, 2k]$. In other words the vector $[0,0,0]$ in $UVW$ frame must correspond to $[4i, 6j, 2k]$ in $IJK$ frame. Let's forget the 0.5's in the diagonal for now. We have,

$\begin{bmatrix}
0 & 0 & 0 & 4\\
0 & 0 & 0 & 6\\
0 & 0 & 0 & 2\\
0 & 0 & 0 & 1\\
\end{bmatrix}
\*
\begin{bmatrix}
0\\
0\\
0\\
1\\
\end{bmatrix}
=
\begin{bmatrix}
4\\
6\\
2\\
1\\
\end{bmatrix} $

Next the condition is if we move 1 unit in $IJK$ we move 2 units in $UVW$ or in other words if we move 1 unit in $UVW$ we move 0.5 units in $IJK$. This means if we move from origin to $[1,1,1]$ in $UVW$ we moved half a unit in the $IJK$ frame in each of the axis. Testing the original matrix now we have,

$\begin{bmatrix}
0.5 & 0 & 0 & 4\\
0 & 0.5 & 0 & 6\\
0 & 0 & 0.5 & 2\\
0 & 0 & 0 & 1\\
\end{bmatrix}
\*
\begin{bmatrix}
1\\
1\\
1\\
1\\
\end{bmatrix}
=
\begin{bmatrix}
4.5\\
6.5\\
2.5\\
1\\
\end{bmatrix} $

When constructing matrices this way, you want the translation factor in the last column. This factor is given to you by telling you the origin of the $UVW$ frame in terms of $IJK$ frame. This means the $UVW$ frame is that much displaced/translated when viewed from $IJK$ frame.

Secondly any scaling factor goes along the diagonal like above. This factor was given to you by telling you "If you move $X$ units in 1 frame, you move $Y$ units in the other".
Which is what we want I guess. Is that what you need?


---

