Lines and Planes in Space (3D)

Nerd Cafe

PART 1: Vectors in 3D

A. Position Vector

A position vector points from the origin to a point in space. If a point P(x, y, z), then the position vector is:

r=xi^+yj^+zk^\overrightarrow{r}=x\hat{i}+y\hat{j}+z\hat{k}

B. Vector Between Two Points

If A(x1,y1,z1) and B(x2,y2,z2):

AB=(xbxa,ybya,zbza)\overrightarrow{AB}=(x_{b}-x_{a},y_{b}-y_{a},z_{b}-z_{a})

C. Python Example:

import numpy as np

A = np.array([1, 2, 3])
B = np.array([4, 0, 5])

AB = B - A
print("Vector AB:", AB)

D. Output:

PART 2: Line in Space

A. Vector Equation of a Line

A line passing through point

r0=(x0,y0,z0)\overrightarrow{r_{0}}=(x_{0},y_{0},z_{0})

with direction vector

v=(a,b,c)\overrightarrow{v}=(a,b,c)

is:

r(t)=r0+tv\overrightarrow{r(t)}=\overrightarrow{r_{0}}+t\overrightarrow{v}

This gives:

x=x0+aty=y0+btz=z0+ct\begin{matrix} x=x_{0}+at \\ y=y_{0}+bt \\ z=z_{0}+ct \end{matrix}

B. Python Example:

C. Output:

PART 3: Plane in Space

A. General Equation of a Plane

Given a point

P0=(x0,y0,z0)P_{0}=(x_{0},y_{0},z_{0})

and normal vector

n=(a,b,c)\overrightarrow{n}=(a,b,c)

then:

a(xx0)+b(yy0)+c(zz0)=0a(x-x_{0})+b(y-y_{0})+c(z-z_{0})=0

Which simplifies to:

ax+by+cz=dax+by+cz=d

where:

d=ax0+by0+cz0d=ax_{0}+by_{0}+cz_{0}

B. Python Example:

C. Output:

PART 4: Angle Between Two Lines

Given direction vectors v1,v2​​:

cosθ=v1.v2v1v2cos\theta=\frac{\overrightarrow{v_{1}}.\overrightarrow{v_{2}}}{|\overrightarrow{v_{1}}||\overrightarrow{v_{2}}|}

A. Python Example:

B. Output:

PART 5: Intersection of Line and Plane

To find intersection:

  1. Substitute parametric equations of the line into the plane equation.

  2. Solve for t.

  3. Plug t back into the line to find the point.

A. Python Example:

B. Output:

PART 6: Distance from a Point to a Plane

Given point

P=(x1,y1,z1)P=(x_{1},y_{1},z_{1})

and plane

ax+by+cz+d=0ax+by+cz+d=0

so:

Distance=ax1+by1+cz1+da2+b2+c2Distance=\frac{|ax_{1}+by_{1}+cz_{1}+d|}{\sqrt{a^{2}+b^{2}+c^{2}}}

A. Python Example:

B. Output:

PART 7: Distance Between Parallel Planes

If both planes have the same normal vector:

ax+by+cz+d1=0    and    ax+by+cz+d2=0ax+by+cz+d_{1}=0\;\;and\;\;ax+by+cz+d_{2}=0

so:

Distance=d2d1a2+b2+c2Distance=\frac{|d_{2}-d_{1}|}{\sqrt{a^{2}+b^{2}+c^{2}}}

PART 8: Angle Between Line and Plane

Given a line with direction d and plane normal n:

sinθ=d.ndnsin\theta=\frac{|\overrightarrow{d}.\overrightarrow{n}|}{|\overrightarrow{d}||\overrightarrow{n}|}

A. Python Example:

B. Output:

PART 9: Line of Intersection of Two Planes

If two planes intersect, the line lies in both. To find it:

  1. Take both plane equations.

  2. Solve the system symbolically.

A. Python Example:

B. Output:

Keywords

lines in space, planes in space, vector equations, parametric equations, dot product, cross product, normal vector, point-plane distance, projection onto plane, 3D geometry, vector algebra, line-plane intersection, plane equation, line direction vector, coplanar vectors, distance from point to line, shortest distance, scalar projection, geometric visualization, vector mathematics, nerd cafe

Last updated