# How to determine the order of the translation, rotation, and scaling in affine transform.

**URL:** https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380
**Category:** Beginner Questions
**Tags:** registration
**Created:** [August 11, 2020, 7:36am UTC](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380 "2020-08-11T07:36:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yongjun\_wang](https://discourse.itk.org/user_avatar/discourse.itk.org/yongjun_wang/32/1670_2.png) [@yongjun\_wang](https://discourse.itk.org/u/yongjun_wang)
#### Post date: [August 11, 2020, 7:36am UTC](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380/1 "2020-08-11T07:36:01Z")

</div>

If it includes translation, rotation, and scaling at the same time, how to determine the order of the three transformations?

Thinks!

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [August 11, 2020, 1:46pm UTC](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380/2 "2020-08-11T13:46:01Z")

</div>

For the affine transformation the operation is  
T(\mathbf{x}) = A(\mathbf{x}-\mathbf{c}) + \mathbf{t} + \mathbf{c}

where in your case A=RS , R rotation matrix, S diagonal scaling matrix, \mathbf{t} translation, \mathbf{c} transformation center. For details see [this Jupyter notebook](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/master/Python/22_Transforms.ipynb) (the code there is for SimpleITK but the explanations are the same for ITK and SimpleITK).

---

<div class="post-metadata">

### Author: ![yongjun\_wang](https://discourse.itk.org/user_avatar/discourse.itk.org/yongjun_wang/32/1670_2.png) [@yongjun\_wang](https://discourse.itk.org/u/yongjun_wang)
#### Post date: [August 12, 2020, 5:20am UTC](https://discourse.itk.org/t/how-to-determine-the-order-of-the-translation-rotation-and-scaling-in-affine-transform/3380/3 "2020-08-12T05:20:46Z")

</div>

thinks very much!
