How can I find an orthogonal vector?
228 次查看(过去 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!