LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d Cartesian coordinate rotation

Solved!
Go to solution

Running lv 8.5, am I misunderstanding how this vi works?  I have entered into the vi the following values

 

x: 1

y:  -1

theta: pi/2

 

and the result I'm getting is

 

x: -1

y:  -1

 

It seems like it's rotating in the wrong direction!

 

Additionally see here:

http://zone.ni.com/reference/en-XX/help/371361F-01/gmath/2d_cartesian_coordinate_rotation/

 

Where the rotation matrix shown is not the same as shown in other sources, such as:

http://en.wikipedia.org/wiki/Rotation_matrix

http://mathworld.wolfram.com/RotationMatrix.html

 

I find it hard to believe that no one else has experienced this problem so what am I missing?!

0 Kudos
Message 1 of 4
(4,072 Views)
Solution
Accepted by topic author duerig
You seem to be missing the difference between rotating a point in a fixed coordinate system and rotating the coordinate system.  The sign of the angle is different in the two cases.  This VI does exactly what the name implies, rotating the coordinate system, and the results are exactly what you should expect.  Mathematica, amongst others, assumes that you are rotating a point in a fixed coordinate system, hence the difference.
0 Kudos
Message 2 of 4
(4,067 Views)
Thanks for the clarification!  I supposed I can just edit my existing code to work with this by simply taking the negative of the angles before I run them through this VI.
0 Kudos
Message 3 of 4
(4,061 Views)

It is working right.

 

The function rotates the coordinate system about the origin.  It isn't rotating the point about the origin.

 

A pi/2 is a counter-clockwise rotation of the axes about the origin 90°.  If the point is in the upper right quadrant, +x +y, rotating the axes 90°counter-clockwise will put the point at 1,1 into the lower right quadrant of the new coordinate system +x -y

 

In the wikipedia example, the points are being rotated in the existing coordinate system.

 

It is really all a matter of frame of reference.

0 Kudos
Message 4 of 4
(4,059 Views)