15

I have a plane equation in the form:

Ax + By + Cz + D = 0

Is there any possible way to find out which operations transform the plane to the xy plane?

EDIT: I am guessing you would need a translation and a rotation because sometimes the plane won't intersect the origin so you need to translate it to the origin then rotate. However, I am still confused as to how I'm supposed to get these angles and translations just from the plane equation.

Ogen
  • 2,255
  • 8
  • 31
  • 44

2 Answers2

21

As you have said we have to perform a translation and a rotation.

For the translation note that the plane $ax+by+cz+d=0$ intersects the $z$ axis at $(0,0,-d/c)$ so the translation $\vec{t}:(x,y,z)\rightarrow (x,y,z-d/c)$ give you a plane $ax+by+cz=0$ that passes thorough the origin and is orthogonal to the vector $\vec{v}=(a,b,c)^T$

For the rotation note that the angle between $\vec{v}$ and $\vec{k}=(0,0,1)^T$ is given by: $$ \cos \theta=\dfrac{(\vec{v},\vec{k})}{|\vec{v}|}=\dfrac{c}{\sqrt{a^2+b^2+c^2}} $$ and the axis of rotation have to be orthogonal to $\vec{v}$ and $\vec{k}$ so its versor is: $$ \vec{u}=\dfrac{\vec{v}\times\vec{k}}{|\vec{v}\times\vec{k}|}=\dfrac{1}{\sqrt{a^2+b^2}}\left(b,-a,0\right)^T=(u_1,u_2,0)^T $$ the rotation (if I've not made some typo) is represented by the matrix: $$ \left ( \begin{array}{cccc} \cos \theta +u_1^2 (1-\cos \theta) &u_1u_2 (1-\cos \theta) & +u_2\sin \theta \\ u_1u_2 (1-\cos \theta)& \cos \theta+ u_2^2 (1-\cos \theta)& -u_1 \sin \theta \\ -u_2 \sin \theta & u_1 \sin \theta& \cos \theta \end {array} \right) $$ see here.

EDIT:

To help you compute the rotation matrix more quickly, I've isolated all the quantities that appear:

$ cos \theta = \frac{c}{\sqrt{a^2 + b^2 + c^2}} $

$ sin \theta = \sqrt{\frac{a^2+b^2}{a^2 + b^2 + c^2}} $

$ u_1 = \frac{b}{\sqrt{a^2 + b^2 }} $

$ u_2 = -\frac{a}{\sqrt{a^2 + b^2}} $

Emilio Novati
  • 62,675
  • 2
    This was much more complicated than I thought. It worked perfectly nevertheless. Thank you. – Ogen Feb 28 '15 at 01:20
  • While staring at your solution, @Emilio Novati, I realized we should be able to normalize a, b, and c, but it seems like that would affect the rotation matrix, which It shouldn't. Does normalizing affect the rotation matrix? – Nathan majicvr.com Sep 26 '18 at 17:40
  • Revised: after a moment's thought, I realized that by normalizing all I'm doing anyway is dividing every a, b, and c value through by $\sqrt {a^2 + b^2 + c^2}$. So probably the best way to take a shortcut with computation is to separately compute $a^2 + b^2 + c^2$ and $\sqrt {a^2 + b^2 + c^2}$. – Nathan majicvr.com Sep 26 '18 at 17:45
  • I have a question: how should I apply the rotation matrix? Should I do a a multiplication between the matrix and the vector (a,b,c)? – qcc101 Mar 11 '19 at 16:11
  • Multiplying the matrix by the vector $(a,b,c)$ you find a vector on the $z$ axis, i.e. orthogonal to the $xy$ plane. – Emilio Novati Mar 13 '19 at 09:15
  • 1
    If I plug in $a = b = c = 1$, I get a matrix which is not a rotation, because it is not orthogonal ($R \times R' \neq I$). Am I making a stupid mistake? – chaffdog Feb 11 '21 at 09:48
  • 1
    Is it possible to generalize the solution to this, so rather than mapping from an arbitrary plane to the x-y plane, to instead find a transformation matrix that takes an arbitrary 3d plane to another arbitrary 3d plane? – BeginnersMindTruly Oct 03 '23 at 23:21
  • Yes. The vector $\vec k$ in the answer must be the vector orthogonal to the other plane. – Emilio Novati Oct 04 '23 at 14:24
6

I tried to add this as a comment to Emilio Novati's answer but don't have enough points. The rotation matrix here requires that the vector along the rotation axis, $\vec{u}$, is a unit vector, so:

$$\hat{u}=\dfrac{\vec{v}\times\vec{k}}{|\vec{v}\times\vec{k}|}=\dfrac{1}{\sqrt{a^2+b^2}}\left(b,-a,0\right)^T=(u_1,u_2,0)^T$$

which gives the components:

$u_1 = \frac{b}{\sqrt{a^2 + b^2}}$

$u_2 = -\frac{a}{\sqrt{a^2 + b^2}}$

for the same rotation matrix:

$$\left ( \begin{array}{cccc} \cos \theta +u_1^2 (1-\cos \theta) &u_1u_2 (1-\cos \theta) & u_2\sin \theta \\ u_1u_2 (1-\cos \theta)& \cos \theta+ u_2^2 (1-\cos \theta)& -u_1 \sin \theta \\ -u_2 \sin \theta & u_1 \sin \theta& \cos \theta \end {array} \right)$$

paterry
  • 61