Given 2 points in 3d, how to generate a plane equation in the form $lx+my+nz=d$

1.3k Views Asked by At

I can do this for 2d points by getting the 2 parametric equations for $x$ and $y$ and then solving by eliminating $t$ and getting the 2d equivilent line equation. There is only one line equation in this case though.

In 3d there will be infinitely many planes but I only need one of them for my use case. I can still generate the symmetric line by doing the below

\begin{align*}x & = {x_0} + ta\\ y & = {y_0} + tb\\ z & = {z_0} + tc\end{align*}

which rearranges to

\begin{align*}\frac{{x - {x_0}}}{a} = \frac{{y - {y_0}}}{b} = \frac{{z - {z_0}}}{c}\end{align*}

What I want to do is get one of the planes that does go through the 2 points in the form

\begin{align*}lx+my+nz = d\end{align*}

The reason for doing this is to solve a plane / Bezier curve intersection (which I have working in 2d)

Example given the following cubic

\begin{align*}\mathbf{X}(t) = (1-t)^3\mathbf{P}_0 + 3t(1-t)^2\mathbf{P}_1 + 3t^2(1-t)\mathbf{P}_2 + t^3\mathbf{P}_3\end{align*}

And the following line vector equation

\begin{align*}\mathbf{A}\cdot \mathbf{X} = d\end{align*}

with \begin{align*}\mathbf{A} = (l,m,n)\end{align*}

I just need to solve

\begin{align*}(1-t)^3(\mathbf{A} \cdot \mathbf{P}_0) + 3t(1-t)^2(\mathbf{A} \cdot \mathbf{P}_1) + 3t^2(1-t)(\mathbf{A} \cdot \mathbf{P}_2) + t^3(\mathbf{A} \cdot \mathbf{P}_3) - d = 0\end{align*}

to be able to get the intersection points.

So how do I generate a example plane equation that does go through these 2 points?

Update :

I realise with 2 points there are infinitely many planes, I have rephrased the question to ask how to generate one of them or the formula for generating all of them.

2

There are 2 best solutions below

0
On

$$\frac{{x - {x_0}}}{a} = \frac{{y - {y_0}}}{b} = \frac{{z - {z_0}}}{c}$$ means $$ \begin{cases} \frac{{x - {x_0}}}{a} = \frac{{y - {y_0}}}{b}\\ \frac{{y - {y_0}}}{b} = \frac{{z - {z_0}}}{c}\\ \end{cases} $$ The line is given as intersection of two planes. Any linear combinations of the two planes gives a plane passing through the two given points. $$ \begin{cases} b(x - {x_0}) - a(y - {y_0})=0\to bx-ay+h=0\\ c(y - {y_0}) - b(z - {z_0})=0\to cy-bz+k=0\\ \end{cases} $$ $$\alpha:\lambda(bx-ay+h)+\mu(cy-bz+k)=0$$


Easier alternative

Suppose we have two points $P=(1,2,3);\;Q=(2,1,1)$

Vector joining the two points is $\vec{QP}=(1,-1,-2)$

A vector $\vec{n}=(a,b,c)$ is normal to $\vec{QP}$ is $\vec{n}\cdot\vec{QP}=0$, that is

$a-b-2c=0\to b=a-2c$

$\vec{n}=(a,a-2c,c)$

The equation of the plane passing through $P$ and normal to $\vec{n}$ is

$$a(x-x_P)+b(y-y_P)+c(z-z_P)=0$$

$$a(x-1)+(a-2c)(y-2)+c(z-3)=0\to a x+(a -2 c) y+c z+c-3a=0$$

0
On

Suppose given $\dfrac{{x_1 - {x_0}}}{a} = \dfrac{{y_1 - {y_0}}}{b} = \dfrac{{z_1 - {z_0}}}{c}$. Where $x_1 ,y_1 ,z_1$ is any point on the line and $x_0 ,y_0 ,z_0$ is the fixed point on the line.
Imagine another line going through the same fixed point $x_0 ,y_0 ,z_0$. We write this equation as $\dfrac{{x_2 - {x_0}}}{a_1} = \dfrac{{y_2 - {y_0}}}{b_1} = \dfrac{{z_2 - {z_0}}}{c_1}$
Now we consider any line which lies on the plane created by this two line. Consider a point $x,y,z$ on this plane so
$x-x_0 = \alpha(x_1 - {x_0})+\beta(x_2-x_0) = \alpha at+\beta a_1k\\ y-y_0 = \alpha(y_1 - {y_0})+\beta(y_2-y_0) = \alpha bt+\beta b_1k\\ z-z_0 = \alpha(z_1 - {z_0})+\beta(z_2-z_0) = \alpha ct+\beta c_1k\ $

Solve for $\alpha t$ and $\beta k$ from first two equations and replace those in third equation.