cptolemy said:
Hi,
I have a plane, Ax+By+Cz+D=0, that passes through (0,0,0), and intercepts the xy plane at the line y=mx.
How do I rotate the points of the plane to the xy plane?
Kind regards,
CPtolemy
Since you have A,B,C (D should be zero) you can extract the normal vector of the plane.
Now basically you want to rotate your plane with the normal (0,0,1) or a unit vector pointing in the z-direction.
You can find the angle between the two by using the inner product by using
cos(theta) = <V1,V2>/(|V1||V2|)
where V1 is the normal vector of your plane and V2 is the (0,0,1). If both vectors are unit length then you get a simplification cos(theta) = <V1,V2>.
Then you can basically use this information to rotate your points.
The best way I can think of is to use your line of intersection as your axis of rotation and then to use the angle you found above as your angle of rotation. You won't get gimbal lock and it should do the job perfectly assuming all points are on the plane you have in question.
If you're wondering about doing rotations with quaternions Ken Shoemake wrote an article on it, but wikipedia probably covers it in some depth.
Your axis of rotation is basically the vector given by your y=mx. So your rotation axis vector is going to be (cos(gamma),sin(gamma),0) where gamma is arctan(m).