How we can write rotation of 45degree in Matlab
If you mean rotate a vector by 45° then multiply it by (1/2)i, where i = √(-1) to get a 45° anti-clockwise rotation.
Oops! No, this will give a rotation by 90° and halve the magnitude! You need to multiply by exp(i*pi/4).
Alan, I am not familiar with matlab but I am interested in this concept.
Can you try to explain it a little more please? Maybe with a picture.
Does the following help?
Basically we are treating a vector as a complex number with the x-component as the real part and the y-component as the imaginary part.
oh, I didn't see the oops bit before so it makes a little more sense now.
Where do the numbers
0.7071 abd 3.5355 come from? Are they input or output?
The rotation vector (rot) is ei*pi/4
ei*pi/4 = cos(pi/4)+i*sin(pi/4) = 1/√2 + i*1/√2 = 0.7071 + i*0.7071
Then vrot = v*rot =
(2 + 3i)*(0.7071 + 0.7071i) = 2*0.7071-3*0.7071 +i*(2*0.7071 + 3*0.7071) = -0.7071 +i*5*0.7071 = -0.7071 + 3.5355i