Formula Summary

Table of Content

Points

Mid Point

MPQ=P+Q2=(x1+x22,y1+y22)

Distance

d(P,Q)=(x2x1)2+(y2y1)2

Vectors in 2D and 3D

Length

u=x2+y2

Dot product (Info)

ab=axbx+ayby
Result (Scalar) Angle between a and b is...
>0 <90
=0 =90
<0 >90

Angle between 2 vectors

θ=cos1(abab)

Special cases

Dot product result Angle
-1 180
0 90
1 0
^ ONLY WORKS FOR UNIT VECTORS ^

For dot product 1 and -1 NEED to be unit vectors. For dot product 0, it doesn't matter

Checking if vectors are parallel/perpendicular

For parallel

u=cv
u must be a scalar of v

If u and v are unit vectors, can use Dot product, Special cases

For perpendicular

uv=0
See Dot product, Special cases

Vector Projection (Info)

Project b onto a,

General:

projab=baa2a

If a is a unit vector:

projab=(ba^)a^

Checking if moving towards a point

Only 1 point moving

Get vector QP,
Find QPv
At Q , Result < 0, angle is < 90 so moving towards
At Q1, Result = 0, angle is = 90. Neither moving towards/away. This is will only happen for a split second
At Q2, Result > 0, angle is > 90 so moving away

2 points moving

Assume P is stationary **relative** to Q, Then same as [[#Only 1 point moving]] except use:

Result = v1v2PQ

Result < 0, moving towards
Result = 0, Neither moving towards/away
Result > 0, moving away

Vectors in 2D

Making a normal vector

  1. Swap x and y
  2. Negate either the x or y
    • Negate x to rotate 90 anti-clockwise
    • Negate y to rotate 90 clockwise
Example

d=[23]n=[32]

Linear equation

For reference, this is the normal way to represent an equation

y=mx+c

Where

Find using n and 1 point (Proof)

xn=OPn

Expanded out:

ax+by=ax0+by0

Vector equation

Notation

x=P+td     OR     x=(x0,y0)+[ab]

Find vector equation using 2 points

x=P+PQ

Linear Vector equation

ax+by=cn=[ab]d=[ba]Sub x=0 OR y=0 to find P,x=P+td

Parametric equation

{x=x0+tay=y0+tb      t(,)

Finding shortest distance

Point to line

Given x=P+td and Q(x,y)

Dist from Q to line=||projnPQ||
PQ direction

P is a point on the line as the normal starts from the line too

Checking if a moving point will hit line

Hit Miss
Hit if the signs of these 2 are different
QPn<0     !=    vn<0

Excalidraw - Full table

Vectors in 3D

Line

x=P+td
No linear equation for line.

Linear equation in 3D is a Plane

Quick normal vector in 3D

Lines in 3D has infinite number of normal vectors

Steps (Similar to 2D):

Example

d=[234]      n=[043]

Plane

Notation

A plane equation can be represented by α,β,γ, etc...

Vector equation

Using 2 direction vectors, $$\vec{x}=P+s\vec{u}+t\vec{v}$$ > [!WARNING] $\vec{u}$ and $\vec{v}$ cannot be parallel ##### 3 Points $\to$ Vector equation Given $P, Q, R$, $$ \vec{x}=P+s\vec{PQ}+t\vec{PR} $$
Vector Linear equation

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

n=u×vxn=OPn

Linear equation

Same as 2D, $$ \vec{x}\cdot \vec{n}=\vec{OP}\cdot \vec{n} $$ ### Cross product Used to find normal of 2 vectors u×v=[uxuyuz]×[vxvyvz]=[uyvzuzvyuzvxuxvzuxvyuyvx]

To check, make sure

(u×v)u=0
To visualize using right hand rule

  • 4 fingers pointing the direction from uv
  • thumb points to the result of the cross product.

NOTE: u×v=v×u

Related: Point to Line dist in 3D

Distances for lines

Point to Line

!03-L Week 3, p.47

--- 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}
$

Line to Plane

See Plane to Line below

Line to Line

Given l1:x=P+td1 and l2:x=Q+td2,

  1. If d1 parallel to d2
  2. If d1 NOT parallel to d2,
    • Make a plane containing l2 that's parallel to l1
      • nα=d1×d2
      • α:xnα=Qnα
    • Distance = d(P,α)=||projnαQP|| - Plane to Point

Distances for planes

Plane to Point

Same as Point to line dist in 2D

Given x=P+td and Q(x,y,z)

Dist from Q to line=||projnPQ||
PQ direction

P is a point on the plane as the normal starts from the line too

Plane to Line, Plane to Plane

There are 2 cases:

Examples:

--- Plane to Plane
Given planes 
- $\alpha:P,\vec{n}_{\alpha} \implies\vec{x}_{\alpha}\cdot \vec{n}_{\alpha}=\vec{x}_{\alpha}\cdot \vec{OP}$ 
- $\beta:Q,\vec{n}_{\beta}\implies\vec{x}_{\beta}\cdot \vec{n}_{\beta}=\vec{x}_{\beta}\cdot \vec{OQ}$

There are 2 cases:
- $\alpha$ and $\beta$ intersect $\to$ $\vec{n}_{\alpha}$ NOT parallel to $\vec{n}_{\beta}$
$
\text{So, }d(\alpha,\beta)=0
$
- $\alpha$ and $\beta$ are parallel $\to$ $\vec{n}_{\alpha}$ parallel to $\vec{n}_{\beta}$ 
$
d(\alpha,\beta)=d(P,\beta)=||proj_{\vec{n}_{\beta}}{\vec{QP}}||
$
This is same as Plane to Point (Treat the other plane as a point as it's parallel).
--- Plane to Line (css-class: pdf-page-break)
Given:
- $\alpha:P,\vec{n}_{\alpha} \implies\vec{x}_{\alpha}\cdot \vec{n}_{\alpha}=\vec{x}_{\alpha}\cdot \vec{OP}$ 
- $l:Q,\vec{d}\implies \vec{x}=Q+t\vec{d}$ 

There are 2 cases:
- $\alpha$ and $l$ intersect $\to$ $\vec{d}$ NOT $\perp$ $\vec{n}_{\alpha}$ 
$
\text{So, }d(l,\alpha)=0
$
- $\alpha$ and $l$ are parallel $\to$  $\vec{d} \perp \vec{n}_{\alpha}$ 
$
d(l,\alpha)=d(P,\alpha)=||proj_{\vec{n}_{\alpha}}{\vec{QP}}||
$

This is same as Plane to Point (Treat the other line as a point as it's parallel).

Others

Are 2 lines the same

x=P+sd1 and x=Q+td2
Same if (both true):