Find a new ortonormal coordiante vectors with a point and vector given
1 次查看(过去 30 天)
显示 更早的评论
Hi, for an university problem, I have to find a new tern with the origin in the point P1=[2 2 1], the z axis oriented along the vector N=[1 1 2] and with the x and y axes belonging to the plane passing through point P1 and identified from the normal N. I also have to make it's graphic representation, with red color for the x axis, green for y and blue for z. All that I can manage to do was using null space
clc;
clear all;
P1=[2 2 1];
N=[1 1 2];
VN=N/norm(N);
BVN=null(VN);
NV=[BVN(:,1) BVN(:,2) VN'];
回答(1 个)
Brahmadev
2023-9-26
Hi Federico,
I understand that you would like to get two vectors normal to the given vector originating at P1 = [2 2 1] towards N = [1 1 2]. If we assume a random vector, say, towards N1 = [1 1 3] from P1, we can get their cross-product to find a vector that is normal to P1N. If we further take the cross-product of P1N and P1N1, we can get the third vector which will be normal to both these vectors. This can be chosen as our third co-ordinate axes.
Further, "quiver3" can be used to plot these vectors and it's "LineSpec" can be used to set the color or the lines as you mentioned.
You can refer to the following documentation to know more about “quiver3” function:
Hope this helps in solving your issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!