Ask Your Question
1

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

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

mayank_m gravatar image

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

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

Comments

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 imageJavier V. Gómez ( 2016-02-05 04:23:50 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

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

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 296 times

Last updated: Feb 05 '16