フィルターのクリア

The angle and distance between the two vectors.

1 回表示 (過去 30 日間)
Yonghyun
Yonghyun 2017 年 2 月 13 日
編集済み: Roger Stafford 2017 年 2 月 14 日
In a two-dimensional vector space, assume that there is one vector u(a, b) and another unknown vector v(c, d). If I knew angle and distance between these two vectors, how can I calculate the unknown vector v? I means the elements of a vector v. If I can calculate, how should I apply in Matalb??
Thank you very much.
  2 件のコメント
Honglei Chen
Honglei Chen 2017 年 2 月 13 日
could you clarify how the distance is defined between two vectors?
YongHyun
YongHyun 2017 年 2 月 14 日
Both vectors have origin (0,0) and the distance means the distance between the end points of the vector. Thanks.

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

採用された回答

Roger Stafford
Roger Stafford 2017 年 2 月 14 日
You have a known vector u = [a,b] and an unknown vector v = [c,d]. The distance as you have defined it is a known
r = sqrt((c-a)^2+(d-b)^2)
and the angle in radians measured counterclockwise from u to v is a known A. You are to find v.
B = atan2(b,a);
C = cos(A+B);
S = sin(A+B);
t1 = a*C+b*S+sqrt(r^2-(a*S-b*C)^2);
t2 = a*C+b*S-sqrt(r^2-(a*S-b*C)^2);
c1 = t1*C;
d1 = t1*S;
c2 = t2*C;
d2 = t2*S;
v1 = [c1,d1];
v2 = [c2,d2];
As you can see, there will generally be two real solutions or none.
  2 件のコメント
Jan
Jan 2017 年 2 月 14 日
One solution is possible also.
Roger Stafford
Roger Stafford 2017 年 2 月 14 日
編集済み: Roger Stafford 2017 年 2 月 14 日
Yes, you're right Jan. If the line of the vector happens to be exactly tangent to the circle of radius r, there will be just one solution. That's why I qualified my statement with the word 'generally'.

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

その他の回答 (1 件)

KSSV
KSSV 2017 年 2 月 14 日

カテゴリ

Help Center および File ExchangeAntenna and Array Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by