13 lines
297 B
Matlab
Executable File
13 lines
297 B
Matlab
Executable File
function angle = arot(mx,my,j,i) %Unit vectors
|
|
|
|
if my(i,j)>0
|
|
angle = 90-(atan(mx(i,j)/my(i,j)))*180/pi;
|
|
elseif my(i,j)<0
|
|
angle = 270-(atan(mx(i,j)/my(i,j)))*180/pi;
|
|
elseif (my(i,j)==0)&&(mx(i,j)<0)
|
|
angle = 180.0;
|
|
elseif (my(i,j)==0)&&(mx(i,j)>0)
|
|
angle = 0.0;
|
|
end
|
|
|
|
end |