# Rotate and translate a node around a specified point

**URL:** <https://discourse.slicer.org/t/rotate-and-translate-a-node-around-a-specified-point/30232>\
**Category:** Support\
**Created:** [June 26, 2023, 9:01am UTC](https://discourse.slicer.org/t/rotate-and-translate-a-node-around-a-specified-point/30232 "2023-06-26T09:01:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IsabelW96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/isabelw96/32/66474_2.png) [@IsabelW96](https://discourse.slicer.org/u/IsabelW96)\
**Post date:** [June 26, 2023, 9:01am UTC](https://discourse.slicer.org/t/rotate-and-translate-a-node-around-a-specified-point/30232/1 "2023-06-26T09:01:02Z")

</div>

Hi everyone,

I’ve tried to transform a node around a specified point script to work. The models are illustrated below. The red one is the reference model with the defined centroid (F-1).

 ![Schermafbeelding 2023-06-26 105816](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/a/fa456354d3f8ea63547c08e857faa24957ef3bf3.png)

I followed the video as described here:

> [@Rotation around specific point](https://discourse.slicer.org/t/rotation-around-specific-point/9398/11):
>
> I’ve just tried the [script](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rotate-a-node-around-a-specified-point) that I posted earlier and it worked well. I’ve recorded it on a [video](https://1drv.ms/v/s!Arm_AFxB9yqHucN9pd6edw1a1cgxbg?e=x5SJOd) so that you can see all the steps.

The results are illustrated below:

 ![Schermafbeelding 2023-06-26 103833](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/8/48db7c2e3539734ebefe158992c5bbf7a22ba8aa.png)  
 ![Schermafbeelding 2023-06-26 104626](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/2/d2414fe59c2bd74b29a1ed882611244678c830f4.png)

So my question is, does this script only perform the rotation? Because I also need the translation that is needed to align these models.

I already performed ALPACA on these models to align them and get the transformation matrix that I copied to ‘rotationTransformNode’, but I want to know the total transform (rotation + translation) around a specific point (centroid) that I defined as F-1. I thought the script mentioned earlier would be the solution, but it only performs rotation, I guess…

Does anyone know how to include also the translations?

I’m working with slicer 5.2.2.

Any help would be appreciated!
