# What is the corresponding matrix to the transformation/rotation I need?

**URL:** <https://discourse.slicer.org/t/what-is-the-corresponding-matrix-to-the-transformation-rotation-i-need/24553>\
**Category:** Support\
**Tags:** transforms\
**Created:** [July 29, 2022, 2:08am UTC](https://discourse.slicer.org/t/what-is-the-corresponding-matrix-to-the-transformation-rotation-i-need/24553 "2022-07-29T02:08:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsalas424](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jsalas424](https://discourse.slicer.org/u/jsalas424)\
**Post date:** [July 29, 2022, 2:08am UTC](https://discourse.slicer.org/t/what-is-the-corresponding-matrix-to-the-transformation-rotation-i-need/24553/1 "2022-07-29T02:08:06Z")

</div>

I have the following x, y, z coordinates:

```auto
-X Z Y
-16.215 126.065 12.236
-16.149 125.708 14.237
-16.843 125.851 13.707
... ... ...

```

Corresponding to matrix:

```auto
1.00 0.00 0.00 0.00
0.00 1.00 0.00 0.00
0.00 0.00 1.00 0.00

```

I need to transform them back to:

```auto
X Y Z
16.215 12.236 126.065
16.149 14.237 125.708
16.843 13.707 125.851
... ... ...

```

and find the corresponding matrix.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [July 29, 2022, 5:41pm UTC](https://discourse.slicer.org/t/what-is-the-corresponding-matrix-to-the-transformation-rotation-i-need/24553/2 "2022-07-29T17:41:51Z")

</div>

I think what you are asking is for a matrix which takes a three element vector and transforms it to another three element vector where the output vector has as its first element the negative of the first element of the input vector, has as its second element the third element of the input vector, and has as its third element the second element of the input vector. That matrix is just

```auto
 -1 0 0
  0 0 1
  0 1 0

```

---

<div class="post-metadata">

**Author:** ![jsalas424](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jsalas424](https://discourse.slicer.org/u/jsalas424)\
**Post date:** [July 29, 2022, 6:11pm UTC](https://discourse.slicer.org/t/what-is-the-corresponding-matrix-to-the-transformation-rotation-i-need/24553/3 "2022-07-29T18:11:38Z")

</div>

This is it, thanks for the help!

This corresponds to a +180\* posterior/anterior rotation then a +90\* left/right rotation.
