# Rotation angle clockwise or anticlockwise?

1. Jun 14, 2009

### whitenight541

Hi all,

I want to implement rays emitted from diffraction by a wedge. So I have a wedge with 2 faces ,a common edge and an incident ray. I have the tangent and normal to each face. I calculated the base of the diffracted rays so that it lies in one of the faces. I want to rotate this ray several times about the edge until I reach the other face.

I have the rotation matrix. The problem is I can't determine whether my rotation angle is clockwise or anticlockwise. I can rotate in one direction only (since it is a wedge and rays shouldn't go inside the walls).

Is there any vector operation I can use to determine this?

2. Jun 14, 2009

### D H

Staff Emeritus
Clockwise or counterclockwise with respect to what? You need a reference direction to say whether some rotational motion is clockwise or counterclockwise. Imagine you have a transparent clock hanging like a chandelier. Viewed from one side the hands appear to move clockwise, but from the other side they appear to move counterclockwise.

3. Jun 14, 2009

### junglebeast

A positive rotation rotates from (1,0) to (0,1). Usually (1,0) is defined as right, and (0,1) can either be up or down depending on if you are drawing a typical graph (where it is up) or considering pixels on the screen (where it is down). If you just have a rotation matrix and you don't know whether or not it represents positive or negative rotation, use it to transform the vector (1,0) and see where it goes.

4. Jun 14, 2009

### whitenight541

Well with respect to the faces of the wedge. Denote one face as faceO and the other as faceN. I want to partition the angle from faceO to faceN to emit several rays through it. Ofcourse this angle is the outside of the wedge not inside it (so it can be > 180).

For example let a wedge has an inner angle of 90. So this means that i want to emit rays in the external 270 degrees starting from faceO to faceN. The problem is if I started at faceO I don't know in what direction should I rotate in order to reach faceN (through the external 270 degrees)

I have the rotation matrix with the angle as a variable so I have to specify the angle. if positive then counterclockwise if negative then clockwise.

5. Jun 14, 2009

### HallsofIvy

what is your rotation matrix? A rotation about angle $\theta$ can be written as the matrix
[tex]\begin{bmatrix}cos(\theta) & -sin(\theta) \\ sin(\theta) & cos(\theta)\end{bmatrix}[/itex]

Because $sin(-\theta)= -sin(\theta)$, if the number $-sin(\theta)$ in the "upper right" of your matrix is negative, this is a rotation through a positive angle, an anti-clockwise rotation. If it is positive, it is a rotation through a negative angle, a clockwise rotation.

6. Jun 14, 2009

### whitenight541

No, this is a rotation about an arbitrary axis so the rotation matrix is more complicated than this.

It is found here http://en.wikipedia.org/wiki/Rotation_matrix" [Broken]

Last edited by a moderator: May 4, 2017