3. Vectors - 3D

Lines

Notation

A line in 3D is determined by a point P=(x0,y0,z0) and a direction vector d=[d1d2d3]

x=P+td
Note

  • This is DIFFERENT from [[#Planes]]
  • Since it only has 1 direction vector

Quick normal vector in 3D

Lines in 3D has infinite number of normal vectors

Steps (Similar to 2D):

Example

d=[234]      n=[043]

Planes

Notation

Vector equation

Using 2 direction vectors,

x=P+su+tv
u and v cannot be parallel
3 Points Vector equation

Given P,Q,R,

x=P+sPQ+tPR
Vector Linear equation

Find n using u×v and then form the Linear equation

n=u×vxn=OPn

Linear equation

To find a point on the plane, sub 2 variables to any value and solve the last value
Find a point on plane

Given 3x2yz=4, get a point on the plane
Sub x=0, y=0,$$\begin{align}
0-0-z&=-4\
z=4 \
P=(0,0,4)
\end{align}$$

Cross product

Used to find a vector that's perpendicular to the 2 vectors

u×v=[uxuyuz]×[vxvyvz]=[uyvzuzvyuzvxuxvzuxvyuyvx]

To check:

(u×v)u=0

Cross product Laws

Law Note
u×v=(v×u) Swap u and v when negating
u×(v+w)=u×v+u×w
(u+v)×w=u×w+v×w
u×v=0 if u and v are parallel Also applies to u×u=0
as u is parallel to itself
u×0
c(u×v)=(cu)×v=u×(cv) The scalar (c) only applies to 1 vector

Finding area of triangle with cross product

Given 3 points - P, Q and R

Area of PQR=12||PQ×PR||

Calculating Distances

Distances for lines

Point to Line

--- Using cross product (recommended)
$d(P,l)=\frac{\text{Area of parallelogram}}{||\vec{d}||}=\frac{||\vec{QP}\times \vec{d}||}{||\vec{d}||}$

--- Using projection
$
\begin{align}
\vec{QH}&=proj_{\vec{d}}{\vec{QP}} \\
\vec{HP}&=\vec{HQ}+\vec{QP} \\
d(P,l)&=||\vec{HP}||
\end{align}
$
Cannot use the same method used in 2D (projection onto normal)

As a line in 3D has infinite normals

Calculating Angles