How can I find an orthogonal vector?

222 ビュー (過去 30 日間)
Sue Swenson
Sue Swenson 2021 年 5 月 2 日
コメント済み: William 2024 年 1 月 14 日
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
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
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 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by