How can I rotate a vector by a certain amount along a specific plane?

23 次查看(过去 30 天)
I have three points in inertial space which is enough to specify a plane. I have a vector that lies in this plane, and would like to rotate this vector so that it becomes perpendicular with its original self, through a rotation about the plane. For example:
my points:
a=[1 .3 .5];
b=[0 0 0];
c=[4 5 6];
%plane passes through points a, b, and c, a is the vector to rotate
EDIT
I mean to say a rotation on the plane (rotating with the pivot being the origin 0,0,0)

采纳的回答

Alessandro Maria Laspina
To find the vector that is in the same plane as the points c, a, and b, which is orthogonal to a we must:
1) first find the vector that is orthogonal to the plane CAB that passes through point b.
2) Rotate a about this vector 90 degrees.
To do this we can use the procedure described by @Bjorn Gustavsson(vector g is the plane that is orthogonal to plane c,a, and b)
Then, using the rodrigues equation (Rodrigues' rotation formula - Wikipedia), we plug in a for v, and k for g with theta being pi/2 and finally we obtain our correct vector.

更多回答(1 个)

Bjorn Gustavsson
Bjorn Gustavsson 2021-5-31
编辑:Bjorn Gustavsson 2021-6-1
Simply take another vector that lies in your plane, here c (you should understand why we can use c straight away). Then form an array that's in the plane but perpendicular to a:
d = c-dot(c,a)*a;
Then you get a vector that's perpendicular to a:
g = cross(a,d);
Here you'll have to plug in a normalization in order to not scale a. That was for rotating a out of the plane. For the rotation around the normal-vector of the plane you're close to done after the calculation of d - just normalize it to give it the same length as a.
HTH
  8 个评论
Alessandro Maria Laspina
编辑:Alessandro Maria Laspina 2021-6-3
Thanks for the help, have a look at the answer- I may have complicated things a little bit but you definitely helped me get to where I needed.
Bjorn Gustavsson
Bjorn Gustavsson 2021-6-3
OK, now I think I've fixed the typos properly. The correct equation should be:
d = c-dot(c,a/norm(a))*a/norm(a); % subtract the projection of c in the direction of a to get a vector perp to a
d = d*norm(a)/norm(d); % scaled to same length of a

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by