フィルターのクリア

reducing an angle from 30 degree to 20 degree and increasing angle form 280 degree to 20

3 ビュー (過去 30 日間)
consider that there are two vectors A and B , A is at angle of 30 degree to x axis and B is at an angle of 280 degree to x axis. an applied magnetic field is at an angle of 20 degree to x axis . the magnetic field will align both vectors in its direction of 20 degrees. the nearest angle to be traveled by A is 10 degree back towards X and reach magnetic field at 20 degrees and for B is move from 280 on wards and get aligned with magnetic field ( B will travel 100 degrees to reach magnetic field). Anyone who can guide me for this ....... we can use random numbers to move the vectors.
Regards 4 X 4

採用された回答

Thorsten
Thorsten 2015 年 5 月 28 日
You can use my function angdiff to compute the angular difference. Note that the angles have to be given in rad; rad = deg/180*pi.
function d = angdiff(alpha1, alpha2)
%ANGDIFF Angular difference in counter-clockwise direction.
%
% D = ANGDIFF(ALPHA1, ALPHA2)
%
%AlPHA1 and AlPHA2 have to be in radians.
%
% Thorsten.Hansen@psychol.uni-giessen.de 2015-05-28
d = rem(alpha1 - alpha2, 2*pi);
if d > pi
d = 2*pi - d;
end
  2 件のコメント
Offroad Jeep
Offroad Jeep 2015 年 5 月 28 日
Not suitable..............
Thorsten
Thorsten 2015 年 5 月 28 日
It would be helpful if you pose a specific question. What do you want to achieve, what have you tried so far, where did you got stuck?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by