How can I find an orthogonal vector?
222 ビュー (過去 30 日間)
古いコメントを表示
This seems like it should be simple, but I haven't been able to figure out how to use Matlab to calculate an orthogonal vector.
If my vector is:
syms a
p=[1;-a;0]
Then dot(p, the_orthogonal_vector) should = 0. But how can I calculate the orthogonal vector? I tried
help null
but couldn't see how to apply that to this.
1 件のコメント
William
2024 年 1 月 14 日
The vector you gave is on the xy plane, therefore one of the orthogonal vectors is also on that plane. The formula for that is to transpose the x and y values and change the sign of one of them. For example, the vector u = [a;1;0] is orthogonal to p. v = [-a;-1;0] is also orthogonal. This is a special case where vectors on one of the primary planes, xy, xz, yz, can use the transpose and a sign change to find an orthogonal vector.
採用された回答
David Goodmanson
2021 年 5 月 2 日
編集済み: David Goodmanson
2021 年 5 月 2 日
Hello Sue,
use null of the transpose of p:
syms a
p=[1;-a;0]
n = null(p.')
n =
[ a, 0]
[ 1, 0]
[ 0, 1]
and each column of n is perpendicular to p, as is any linear combination of those two columns.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Numbers and Precision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!