# How to rotate around an arbitrary axis?

**URL:** <https://tech-community.robotics.abb.com/t/how-to-rotate-around-an-arbitrary-axis/11853>\
**Category:** RAPID Programming\
**Tags:** axis, rotation, tool-center-point\
**Created:** [March 31, 2025, 8:22am UTC](https://tech-community.robotics.abb.com/t/how-to-rotate-around-an-arbitrary-axis/11853 "2025-03-31T08:22:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nihm20](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nihm20](https://tech-community.robotics.abb.com/u/nihm20)\
**Post date:** [March 31, 2025, 8:22am UTC](https://tech-community.robotics.abb.com/t/how-to-rotate-around-an-arbitrary-axis/11853/1 "2025-03-31T08:22:26Z")

</div>

I have defined a new TCP that is offset from tool0. I want to do a rotation around my new tcp’s z-axis (the blue axis in the figure). How do I do that?

---

<div class="post-metadata">

**Author:** ![nihm20](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nihm20](https://tech-community.robotics.abb.com/u/nihm20)\
**Post date:** [March 31, 2025, 8:22am UTC](https://tech-community.robotics.abb.com/t/how-to-rotate-around-an-arbitrary-axis/11853/2 "2025-03-31T08:22:57Z")

</div>

![](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/e/edcbc511450a015dde6527c26326c6b22c686874.png)

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [March 31, 2025, 9:53am UTC](https://tech-community.robotics.abb.com/t/how-to-rotate-around-an-arbitrary-axis/11853/3 "2025-03-31T09:53:59Z")

</div>

Hi…  
Take a look at the RelTool() function.  
Good Job
