4
votes

I have a 3d plane (made up of number of points) which is rotated at weird angle. I want to make it flat i.e lie on xy-plane. I have plane equation but I think my calculated angles are not correct or might be using wrong rotation matrix. By wrong rotation matrix is that I meant that I am not sure about which axis should I rotate. attached is the picture of my plane:

this plane is rotated about  more then one axis

I tried to calculate by using following formulas:

  1. theta=-acosd((dot(n1,n2))/(norm(n1)*norm(n2)));
  2. Calculate spherical angles: theta and phi;

both methods are giving same angle, I rotated my plane first about z-axis and then about y-axis. The resulted plane is almost flat but it still has some anlge.

I tried both rotation matrix and Rodrigues' rotation matrix. It would be really helpful if someone could suggest how to rotate this plane to make it flat.

1
If you want a flat plane, you immediately know the plane equation: z = h, where h is an arbitrary height (the height of the point you would rotate about). What are n1 and n2 in your formulas? The two methods should not give the same results as the rotation axes are different.Nico Schertler
Why rotate? You have the plane's normal vector, so it should be a straightforward exercise to find two perpendicular vectors contained in the plane. Use those as the new coordinate basis.Rody Oldenhuis
@NicoSchertler, Thanks for responding. n1=[0 0 1] and n2 is normal to the plane. The formula in 1. and spherical angle theta are giving same value of theta. Could you please explain in detail how to rotate about height??Swati Jain
@RodyOldenhuis , are you saying that find two vectors perpendicular to each other lying in the plane? How to use them as the new coordinates? Little more detail will be helpful. Thank you!Swati Jain
What I meant is that you don't need to calculate any angle or rotation in order to get a flat plane. Can you provide some more context?Nico Schertler

1 Answers

1
votes

When a plane is not parallel to the xy-plane, then it's normal vector will not be parallel to the z-axis. So the cross product of the normal vector and the z-axis (unit) vector will be non-zero. This vector is in the plane and parallel to the xy-plane. Take it as rotation axis. The rotation angle to make the plane parallel to the xy-plane is the same as the angle between the normal vector and the z-axis.