ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to rotate a point(x,y) about a fixed point

asked 2016-02-05 00:30:48 -0600

mayank_m gravatar image

updated 2016-02-05 00:45:38 -0600

I want to rotate a point (x,y) from an orientation alpha to a new point(x,y) with an orientation beta about a fixed point (centre of the circle). How to do it in ROS ?

edit retag flag offensive close merge delete


I do not know if ROS has libraries for this, but Eigen might be useful as it can apply transformations to vectors.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2016-02-05 04:23:50 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-02-05 09:10:06 -0600

updated 2016-02-05 10:53:26 -0600

General Answer, also valid for 3D:

  1. Translate your point, so that your rotation axis goes through the origin of your coordinate system.
  2. Rotate the transformed point around your axis.
  3. Translate the origin of the coordinate system back to the old position.

In your case (P is the point to rotate, F is the rotation point, R is the rotation matrix):

P' = F+(R*(P-F))

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-02-05 00:30:48 -0600

Seen: 851 times

Last updated: Feb 05 '16