This content originally appeared on DEV Community and was authored by ccarcaci
α\alphaα
is a plane in the space and we've been told in school that its equation in canonical form is:
ax+by+cz+d=0
ax+by+cz+d=0
ax+by+cz+d=0
But this doesn't tell us nothing about the plane characteristics and no-one explained us how this equation is formed.
Plane formation
A plane in the space could be identified by a point and 2 non-parallel vectors.
P=(x0,y0,z0)∈αu‾,v‾∈α
P=(x_0,y_0,z_0)\in \alpha \\
\\
\underline{u},\underline{v}\in \alpha
P=(x0,y0,z0)∈αu,v∈α

u‾,v‾\underline{u},\underline{v}u,v
have magnitude, direction, and orientation. It's possible to write:
u‾=PQv‾=PR
\underline{u}=PQ \\
\underline{v}=PR
u=PQv=PR
Every other point
XXX
that belongs to
α\alphaα
could be written as a linear combination of these elements starting from the origin:
OX=OP+s∗u‾+t∗v‾X=(x,y,z)∈αs∈Rt∈R
OX=OP+s*\underline{u}+t*\underline{v} \\
X=(x,y,z)\in\alpha \\
s\in R \\
t\in R
OX=OP+s∗u+t∗vX=(x,y,z)∈αs∈Rt∈R
This clarifies why it is possible to say:
A plane in the space could be identified by a point and 2 non-parallel vectors.
Parametric equations
XXX
can be described by its parametric equations:
x=x0+m1∗s+m2∗ty=y0+n1∗s+n2∗tz=z0+p1∗s+p2∗tu‾=(m1,n1,p1)v‾=(m2,n2,p2)
x=x_0+m_1*s+m_2*t \\
y=y_0+n_1*s+n_2*t \\
z=z_0+p_1*s+p_2*t \\
\underline{u}=(m_1,n_1,p_1) \\
\underline{v}=(m_2,n_2,p_2)
x=x0+m1∗s+m2∗ty=y0+n1∗s+n2∗tz=z0+p1∗s+p2∗tu=(m1,n1,p1)v=(m2,n2,p2)
The goal is to solve this system over
sss
and
ttt
reducing it to a linear equation that is satisfied for the points belongings to the plane.
A bit of math
t=x−x0−m1∗sm2t=y−y0−n1∗sn2t=z−z0−p1∗sp2
t=\frac{x-x_0-m_1*s}{m_2} \\
t=\frac{y-y_0-n_1*s}{n_2} \\
t=\frac{z-z_0-p_1*s}{p_2}
t=m2x−x0−m1∗st=n2y−y0−n1∗st=p2z−z0−p1∗s
Equal over
ttt
:
x−x0−m1∗sm2=y−y0−n1∗sn2x−x0−m1∗sm2=z−z0−p1∗sp2
\frac{x-x_0-m_1*s}{m_2}=\frac{y-y_0-n_1*s}{n_2} \\
\frac{x-x_0-m_1*s}{m_2}=\frac{z-z_0-p_1*s}{p_2}
m2x−x0−m1∗s=n2y−y0−n1∗sm2x−x0−m1∗s=p2z−z0−p1∗s
ttt
is gone, let's target
sss
x−x0m2−m1m2∗s=y−y0n2−n1n2∗sx−x0m2−m1m2∗s=z−z0p2−p1p2∗s
\frac{x-x_0}{m_2}-\frac{m_1}{m_2}*s=\frac{y-y_0}{n_2}-\frac{n_1}{n_2}*s \\
\frac{x-x_0}{m_2}-\frac{m_1}{m_2}*s=\frac{z-z_0}{p_2}-\frac{p_1}{p_2}*s
m2x−x0−m2m1∗s=n2y−y0−n2n1∗sm2x−x0−m2m1∗s=p2z−z0−p2p1∗s
x−x0m2−y−y0n2=(m1m2−n1n2)∗sx−x0m2−z−z0p2=(m1m2−p1p2)∗s
\frac{x-x_0}{m_2}-\frac{y-y_0}{n_2}=(\frac{m_1}{m_2}-\frac{n_1}{n_2})*s \\
\frac{x-x_0}{m_2}-\frac{z-z_0}{p_2}=(\frac{m_1}{m_2}-\frac{p_1}{p_2})*s
m2x−x0−n2y−y0=(m2m1−n2n1)∗sm2x−x0−p2z−z0=(m2m1−p2p1)∗s
A=x−x0m2B=y−y0n2C=m1m2D=n1n2E=z−z0p2F=p1p2
A=\frac{x-x_0}{m_2} \\
B=\frac{y-y_0}{n_2} \\
C=\frac{m_1}{m_2} \\
D=\frac{n_1}{n_2} \\
E=\frac{z-z_0}{p_2} \\
F=\frac{p_1}{p_2}
A=m2x−x0B=n2y−y0C=m2m1D=n2n1E=p2z−z0F=p2p1
A−B=s∗(C−D)A−E=s∗(C−F)
A-B=s*(C-D) \\
A-E=s*(C-F)
A−B=s∗(C−D)A−E=s∗(C−F)
s=A−BC−Ds=A−EC−F
s=\frac{A-B}{C-D} \\
s=\frac{A-E}{C-F}
s=C−DA−Bs=C−FA−E
(A−B)(C−F)=(A−E)(C−D)AC−AF−BC+BF=AC−AD−CE+DE−AF−BC+BF=−AD−CD+DEAF−AD+BC−BF−CE+DE=0A∗(F−D)+B∗(C−F)+E∗(D−C)=0
(A-B)(C-F)=(A-E)(C-D) \\
AC-AF-BC+BF=AC-AD-CE+DE \\
-AF-BC+BF=-AD-CD+DE \\
AF-AD+BC-BF-CE+DE=0 \\
A*(F-D)+B*(C-F)+E*(D-C)=0
(A−B)(C−F)=(A−E)(C−D)AC−AF−BC+BF=AC−AD−CE+DE−AF−BC+BF=−AD−CD+DEAF−AD+BC−BF−CE+DE=0A∗(F−D)+B∗(C−F)+E∗(D−C)=0
x−x0m2(p1p2−n1n2)+y−y0n2(m1m2−p1p2+z−z0p2∗(n1n2−m1m2)=0
\frac{x-x_0}{m_2}(\frac{p_1}{p_2}-\frac{n_1}{n_2})+\frac{y-y_0}{n_2}(\frac{m_1}{m_2}-\frac{p_1}{p_2}+\frac{z-z_0}{p_2}*(\frac{n_1}{n_2}-\frac{m_1}{m_2})=0
m2x−x0(p2p1−n2n1)+n2y−y0(m2m1−p2p1+p2z−z0∗(n2n1−m2m1)=0
a=p1p2−n1n2m2b=m1m2−p1p2n2c=n1n2−m1m2p2
a=\frac{\frac{p_1}{p_2}-\frac{n_1}{n_2}}{m_2} \\
b=\frac{\frac{m_1}{m_2}-\frac{p_1}{p_2}}{n_2} \\
c=\frac{\frac{n_1}{n_2}-\frac{m_1}{m_2}}{p_2}
a=m2p2p1−n2n1b=n2m2m1−p2p1c=p2n2n1−m2m1
a∗(x−x0)+b∗(y−y0)+c∗(z−z0)=0ax+by+cz−ax0−by0−cz0=0d=−ax0−by0−cz0ax+by+cz+d=0
a*(x-x_0)+b*(y-y_0)+c*(z-z_0)=0 \\
ax+by+cz-ax_0-by_0-cz_0=0 \\
d=-ax_0-by_0-cz_0 \\
ax+by+cz+d=0
a∗(x−x0)+b∗(y−y0)+c∗(z−z0)=0ax+by+cz−ax0−by0−cz0=0d=−ax0−by0−cz0ax+by+cz+d=0
w‾=(a,b,c)
\underline{w}=(a,b,c)
w=(a,b,c)
This is the directional vector of the plane, orthogonal to it.
Geometry
To prove that
w‾\underline{w}w
is orthogonal to the plane, it should be orthogonal to both
u‾\underline{u}u
and
v‾\underline{v}v
.
The scalar product should be 0:
w‾⋅u‾=0w‾⋅v‾=0
\underline{w}\cdot\underline{u}=0 \\
\underline{w}\cdot\underline{v}=0
w⋅u=0w⋅v=0
w‾⋅u‾=a∗m1+b∗n1+c∗p1=p1p2−n1n2m2∗m1+m1m2−p1p2n2∗n1+n1n2−m1m2p2∗p1
\underline{w}\cdot\underline{u}=a*m_1+b*n_1+c*p_1=\frac{\frac{p_1}{p_2}-\frac{n_1}{n_2}}{m_2}*m_1+\frac{\frac{m_1}{m_2}-\frac{p_1}{p_2}}{n_2}*n_1+\frac{\frac{n_1}{n_2}-\frac{m_1}{m_2}}{p_2}*p_1
w⋅u=a∗m1+b∗n1+c∗p1=m2p2p1−n2n1∗m1+n2m2m1−p2p1∗n1+p2n2n1−m2m1∗p1
w‾⋅u‾=p1p2m1m2−n1n2m1m2+m1m2n1n2−p1p2n1n2+n1n2p1p2−m1m2p1p2=0
\underline{w}\cdot\underline{u}=\frac{p_1}{p_2}\frac{m_1}{m_2}-\frac{n_1}{n_2}\frac{m_1}{m_2}+\frac{m_1}{m_2}\frac{n_1}{n_2}-\frac{p_1}{p_2}\frac{n_1}{n_2}+\frac{n_1}{n_2}\frac{p_1}{p_2}-\frac{m_1}{m_2}\frac{p_1}{p_2}=0
w⋅u=p2p1m2m1−n2n1m2m1+m2m1n2n1−p2p1n2n1+n2n1p2p1−m2m1p2p1=0
w‾⋅v‾=a∗m2+b∗n2+c∗p2=p1p2−n1n2m2∗m2+m1m2−p1p2n2∗n2+n1n2−m1m2p2∗p2=0
\underline{w}\cdot\underline{v}=a*m_2+b*n_2+c*p_2=\frac{\frac{p_1}{p_2}-\frac{n_1}{n_2}}{m_2}*m_2+\frac{\frac{m_1}{m_2}-\frac{p_1}{p_2}}{n_2}*n_2+\frac{\frac{n_1}{n_2}-\frac{m_1}{m_2}}{p_2}*p_2=0
w⋅v=a∗m2+b∗n2+c∗p2=m2p2p1−n2n1∗m2+n2m2m1−p2p1∗n2+p2n2n1−m2m1∗p2=0
This content originally appeared on DEV Community and was authored by ccarcaci