Academic
  • Introduction
  • Artificial Intelligence
    • Introduction
    • AI Concepts, Terminology, and Application Areas
    • AI: Issues, Concerns and Ethical Considerations
  • Biology
    • Scientific Method
    • Chemistry of Life
    • Water, Acids, Bases
    • Properties of carbon
    • Macromolecules
    • Energy and Enzymes
    • Structure of a cell
    • Membranes and transport
    • Cellular respiration
    • Cell Signaling
    • Cell Division
    • Classical and molecular genetics
    • DNA as the genetic material
    • Central dogma
    • Gene regulation
  • Bioinformatics
    • Bioinformatics Overview
  • Deep Learning
    • Neural Networks and Deep Learning
      • Introduction
      • Logistic Regression as a Neural Network
      • Python and Vectorization
      • Shallow Neural Network
      • Deep Neural Network
    • Improving Deep Neural Networks
      • Setting up your Machine Learning Application
      • Regularizing your Neural Network
      • Setting up your Optimization Problem
      • Optimization algorithms
      • Hyperparameter, Batch Normalization, Softmax
    • Structuring Machine Learning Projects
    • Convolutional Neural Networks
      • Introduction
    • Sequence Models
      • Recurrent Neural Networks
      • Natural Language Processing & Word Embeddings
      • Sequence models & Attention mechanism
  • Linear Algebra
    • Vectors and Spaces
      • Vectors
      • Linear combinations and spans
      • Linear dependence and independence
      • Subspaces and the basis for a subspace
      • Vector dot and cross products
      • Matrices for solving systems by elimination
      • Null space and column space
    • Matrix transformations
      • Functions and linear transformations
      • Linear transformation examples
      • Transformations and matrix multiplication
      • Inverse functions and transformations
      • Finding inverses and determinants
      • More Determinant Depth
  • Machine Learning
    • Introduction
    • Linear Regression
      • Model and Cost Function
      • Parameter Learning
      • Multivariate Linear Regression
      • Computing Parameters Analytically
      • Octave
    • Logistic Regression
      • Classification and Representation
      • Logistic Regression Model
    • Regularization
      • Solving the Problem of Overfitting
    • Neural Networks
      • Introduction of Neural Networks
      • Neural Networks - Learning
    • Improve Learning Algorithm
      • Advice for Applying Machine Learning
      • Machine Learning System Design
    • Support Vector Machine
      • Large Margin Classification
      • Kernels
      • SVM in Practice
  • NCKU - Artificial Intelligence
    • Introduction
    • Intelligent Agents
    • Solving Problems by Searching
    • Beyond Classical Search
    • Learning from Examples
  • NCKU - Computer Architecture
    • First Week
  • NCKU - Data Mining
    • Introduction
    • Association Analysis
    • FP-growth
    • Other Association Rules
    • Sequence Pattern
    • Classification
    • Evaluation
    • Clustering
    • Link Analysis
  • NCKU - Machine Learning
    • Probability
    • Inference
    • Bayesian Inference
    • Introduction
  • NCKU - Robotic Navigation and Exploration
    • Kinetic Model & Vehicle Control
    • Motion Planning
    • SLAM Back-end (I)
    • SLAM Back-end (II)
    • Computer Vision / Multi-view Geometry
    • Lie group & Lie algebra
    • SLAM Front-end
  • Python
    • Numpy
    • Pandas
    • Scikit-learn
      • Introduction
      • Statistic Learning
  • Statstics
    • Quantitative Data
    • Modeling Data Distribution
    • Bivariate Numerical Data
    • Probability
    • Random Variables
    • Sampling Distribution
    • Confidence Intervals
    • Significance tests
Powered by GitBook
On this page
  • Vector dot product
  • Dot Product Properties
  • Defining a plane in R3
  • Cross Product
  • Dot and cross product comparison
  • Normal vector from plane equation
  • Point distance to plane
  • Distance between plane

Was this helpful?

  1. Linear Algebra
  2. Vectors and Spaces

Vector dot and cross products

PreviousSubspaces and the basis for a subspaceNextMatrices for solving systems by elimination

Last updated 5 years ago

Was this helpful?

Vector dot product

Dot product 有別於 addition 和 scalar multiplication,他將 output 出一個 scalar value

a⃗⋅b⃗=[a1a2⋮an]⋅[b1b2⋮bn]=a1b1+a2b2+⋯+anbn (A scalar value)\vec{a} \cdot \vec{b} = \begin{bmatrix} a_1\\a_2\\\vdots\\a_n \end{bmatrix} \cdot \begin{bmatrix} b_1\\b_2\\\vdots\\b_n \end{bmatrix} = a_1b_1 + a_2b_2 + \cdots + a_nb_n \text{ (A scalar value)}a⋅b=​a1​a2​⋮an​​​⋅​b1​b2​⋮bn​​​=a1​b1​+a2​b2​+⋯+an​bn​ (A scalar value)

例如

[25]⋅[25]=4+25=29\begin{bmatrix} 2\\5\end{bmatrix} \cdot \begin{bmatrix} 2\\5\end{bmatrix} = 4+25=29[25​]⋅[25​]=4+25=29

而向量的 Length 可以計算為

∥a⃗∥=a1⃗2+a2⃗2+⋯+an⃗2\lVert \vec{a} \rVert = \sqrt{\vec{a_1}^2 + \vec{a_2}^2 + \cdots + \vec{a_n}^2}∥a∥=a1​​2+a2​​2+⋯+an​​2​

在二維向量的情況下,計算其 Length 就像 Pythagorean Theorem 一樣

a⃗=[25],∥a⃗∥=22+52=29\vec{a} = \begin{bmatrix} 2\\5\end{bmatrix}, \lVert \vec{a} \rVert = \sqrt{2^2 + 5^2} = \sqrt{29}a=[25​],∥a∥=22+52​=29​

但這個方法卻可以很有效的計算超過二、三維以上的長度,並且我們可以定義為

Dot Product Properties

  • Commutative, Distributive, Associative

我們可以用二維空間來展示,而且好處是可以套用至更高維的空間

套用這個公式,我們可以得出當 cos 為 90 度的時候,兩個向量的 dot product 必須為零

所以得出了 Perpendicular 的結論,但這個結論不是雙向的,因為 0 vector 不算在裡面

那如果只有給予兩個向量的 dot product 為零,這個情況稱作為 orthogonal

同時也可以知道, 0 vector 可以和任何的向量 orthogonal

Defining a plane in R3

接下來,將可以透過上面的 properties 以及 一個點 和 一個 normal vector 來定義出一個平面的 equation

我們可以從兩個向量 (a, b) 得到 躺在平面 的向量 (a - b),並且他會與 normal vector (n) 相互垂直

舉個例子,假設我們有一個 normal vector 和兩個指到平面的向量

  1. 先求出躺在該平面的向量 (x-x0)

  2. 再用 dot product 來帶入 n 和 (x-x0) 會等於 0 的結果,就可以得到平面方程式

  1. 其實我們也可以直接帶入剛剛上面的公式

Cross Product

要注意的是第二列是顛倒的 !

舉個例子

我們可以利用右手定則看到 cross product 的結果

Dot and cross product comparison

  • Dot Product

這個鄰邊 (adj.) 可以說是 a 向量的投影

所以 dot product 可以象徵是 a 向量的投影和 b向量在同方向的 magnitude

所以在 theta 等於 90 度 (垂直) 時,投影便會不見,dot product 也會等於 0

而 theta 等於 0 (平行) 時,則可以得到 dot product 的最大值

  • Cross Product

這個對邊 (opt.) 可以說是 a 向量垂直於 b 向量的那條線

當 theta 等於 90 度 (垂直) 時,opt 就會變為 a 向量本身,所以得到 cross product 最大值

當 theta 等於 0 (平行) 時,opt 便會消失,cross product 也會等於 0

Normal vector from plane equation

我們可以從平面方程式直接得到 Normal Vector 的方程式

Point distance to plane

要找出某一個不在平面 U 的點 a 和 U 之間的最短距離 d 時

先找到原點指向該平面的向量 b,再和原點到點 a 的向量 a 相減得到 f

透過計算 cos 的公式可以得到 d 的結果,但我們不知道 theta 是多少啊

沒關係, f 跟 d 的角度會跟 U 的法向量 n 一模一樣,我們帶入 n 向量發現分子變成 n 和 f 的 dot product

舉個例子 Find the distance between (2, 3, 1) and plane (x - 2y + 3z = 5)

Distance between plane

我們先找出第二個平面的方程式,因為是平行的,所以他會跟第一個平面的方程式幾乎一樣,只有 d 不同

首先先找出該平面上兩條線的 cross product 得出該平面的 normal vector

接著找出平面上任何一點的和 abc 隨便一點所生成的向量,根據 normal vector 來找出該平面的方程式

由此可知,A 得值為 1,所以第一個平面的方程式應該為

最後帶入 point to plane 的公式即可,point 我們帶 (2, 3, 4),以及題目給的 distance

算出 d 的絕對值為 6

∥a⃗∥=[a1a2⋮an]⋅[a1a2⋮an]=a⃗⋅a⃗∥a⃗∥2=a⃗⋅a⃗\begin{aligned} \lVert \vec{a} \rVert &= \sqrt{\begin{bmatrix} a_1\\a_2\\\vdots\\a_n\end{bmatrix} \cdot \begin{bmatrix} a_1\\a_2\\\vdots\\a_n\end{bmatrix}} = \sqrt{\vec{a} \cdot \vec{a}}\\\\ \lVert \vec{a} \rVert^2 &= \vec{a} \cdot \vec{a} \end{aligned}∥a∥∥a∥2​=​a1​a2​⋮an​​​⋅​a1​a2​⋮an​​​​=a⋅a​=a⋅a​

1. v⃗⋅w⃗=w⃗⋅v⃗2. (v⃗+w⃗)⋅x⃗=(v⃗⋅x⃗+w⃗⋅x⃗)3. (c⋅v⃗)⋅w⃗=c⋅(v⃗⋅w⃗)\begin{aligned} &\text{1. } \vec{v} \cdot \vec{w} = \vec{w} \cdot \vec{v} \\ &\text{2. } \left( \vec{v} + \vec{w} \right) \cdot \vec{x} = \left( \vec{v} \cdot \vec{x}+ \vec{w}\cdot \vec{x} \right) \\ &\text{3. } (c \cdot\vec{v} )\cdot \vec{w} = c \cdot (\vec{v} \cdot \vec{w}) \end{aligned}​1. v⋅w=w⋅v2. (v+w)⋅x=(v⋅x+w⋅x)3. (c⋅v)⋅w=c⋅(v⋅w)​

Cauchy-Schwarz inequality:

∣x⃗⋅y⃗∣≤∥x∥⋅∥y∥∣x⃗⋅y⃗∣=∥x∥⋅∥y∥  ⟺  x⃗=cy⃗ (co-linear)\lvert \vec{x}\cdot\vec{y}\rvert \le \lVert x\rVert \cdot\lVert y\rVert\\\\ \lvert \vec{x}\cdot\vec{y}\rvert = \lVert x\rVert \cdot\lVert y\rVert \iff \vec{x} = c\vec{y} \text{ (co-linear)}∣x⋅y​∣≤∥x∥⋅∥y∥∣x⋅y​∣=∥x∥⋅∥y∥⟺x=cy​ (co-linear)

Triangle inequality:

∥x⃗+y⃗∥≤∥x⃗∥+∥y⃗∥∥x⃗+y⃗∥=∥x⃗∥+∥y⃗∥  ⟺  x⃗=cy⃗∣c>0\lVert \vec{x} + \vec{y} \rVert \le \lVert \vec{x} \rVert + \lVert \vec{y} \rVert\\ \lVert \vec{x} + \vec{y} \rVert = \lVert \vec{x} \rVert + \lVert \vec{y} \rVert \iff \vec{x} = c\vec{y} \mid c>0∥x+y​∥≤∥x∥+∥y​∥∥x+y​∥=∥x∥+∥y​∥⟺x=cy​∣c>0

Angle between two vectors:

a⃗⋅b⃗=∥a⃗∥⋅∥b⃗∥⋅cosθa⃗=c⋅b⃗∣c>0⇒θ=0a⃗=c⋅b⃗∣c<0⇒θ=180∘\begin{aligned} \vec{a} \cdot \vec{b} &= \lVert \vec{a} \rVert \cdot \lVert \vec{b} \rVert \cdot cos\theta\\ \vec{a} &= c\cdot\vec{b} \mid c > 0 \Rightarrow \theta = 0\\ \vec{a} &= c\cdot\vec{b} \mid c < 0 \Rightarrow \theta = 180^\circ \\ \end{aligned}a⋅baa​=∥a∥⋅∥b∥⋅cosθ=c⋅b∣c>0⇒θ=0=c⋅b∣c<0⇒θ=180∘​
a⃗⋅b⃗=∥a⃗∥⋅∥b⃗∥⋅cos⁡(90∘)=∥a⃗∥⋅∥b⃗∥⋅0=0\begin{aligned} \vec{a} \cdot \vec{b} &= \lVert \vec{a} \rVert \cdot \lVert \vec{b} \rVert \cdot \cos(90^\circ)\\ &= \lVert \vec{a} \rVert \cdot \lVert \vec{b} \rVert \cdot 0\\ &= 0 \end{aligned}a⋅b​=∥a∥⋅∥b∥⋅cos(90∘)=∥a∥⋅∥b∥⋅0=0​
a⃗,b⃗ are perpendicular⇒a⃗⋅b⃗=0⇐a⃗,b⃗≠0,a⃗⋅b⃗=0\begin{aligned} \vec{a}, \vec{b} \text{ are perpendicular} &\Rightarrow \vec{a} \cdot \vec{b} = 0\\ &\Leftarrow \vec{a}, \vec{b} \neq \mathbf{0}, \vec{a} \cdot \vec{b} = 0 \end{aligned}a,b are perpendicular​⇒a⋅b=0⇐a,b=0,a⋅b=0​
a⃗⋅b⃗=0  ⟺  a⃗,b⃗ are orthogonal\vec{a} \cdot \vec{b} = 0 \iff \vec{a}, \vec{b}\text{ are orthogonal}a⋅b=0⟺a,b are orthogonal

可以表示成這樣,也就是給定 (x, y, z) 可以滿足以下等式

Ax+By+Cz=DAx + By +Cz = DAx+By+Cz=D
n⃗⋅(a⃗−b⃗)=0[n1n2n3]⋅[a1−b1a2−b2a3−b3]=0n1(a1−b1)+n2(a2−b2)+n3(a3−b3)=0(Ax+By+Cz=D)\begin{aligned} &\vec{n} \cdot (\vec{a}-\vec{b}) = 0 \\ &\begin{bmatrix} n_1\\n_2\\n_3 \end{bmatrix} \cdot \begin{bmatrix} a_1-b_1\\a_2-b_2\\a_3-b_3 \end{bmatrix} = \mathbf{0}\\\\ &n_1(a_1-b_1) + n_2(a_2-b_2) + n_3(a_3-b_3) = 0 \\ &(Ax+By+Cz = D) \end{aligned}​n⋅(a−b)=0​n1​n2​n3​​​⋅​a1​−b1​a2​−b2​a3​−b3​​​=0n1​(a1​−b1​)+n2​(a2​−b2​)+n3​(a3​−b3​)=0(Ax+By+Cz=D)​
n⃗=(1,3,−2)x0⃗=(1,2,3)x⃗=(x,y,z)\begin{aligned} \vec{n} &= (1, 3, -2)\\ \vec{x_0} &= (1,2,3)\\ \vec{x} &= (x,y,z) \end{aligned}nx0​​x​=(1,3,−2)=(1,2,3)=(x,y,z)​
n⃗⋅(x⃗−x0⃗)=0[13−2]⋅[x−1y−2z−3]=01(x−1)+3(y−2)−2(z−3)=0x−1+3y−6−2z+6=0x+3y−2z=1\vec{n} \cdot \left( \vec{x} - \vec{x_0}\right) = \mathbf{0}\\ \begin{bmatrix} 1\\3\\-2\end{bmatrix} \cdot \begin{bmatrix} x-1\\y-2\\z-3\end{bmatrix} = \mathbf{0}\\ 1(x-1)+3(y-2)-2(z-3) =0\\ x-1+3y-6-2z+6=0\\ x+3y-2z=1n⋅(x−x0​​)=0​13−2​​⋅​x−1y−2z−3​​=01(x−1)+3(y−2)−2(z−3)=0x−1+3y−6−2z+6=0x+3y−2z=1
n1(a1−b1)+n2(a2−b2)+n3(a3−b3)= 1(x−1)+3(y−2)−2(z−3)= 0\begin{aligned} & n_1(a_1-b_1) + n_2(a_2-b_2) + n_3(a_3-b_3) \\=\,&1(x-1)+3(y-2)-2(z-3)\\=\,&0 \end{aligned}==​n1​(a1​−b1​)+n2​(a2​−b2​)+n3​(a3​−b3​)1(x−1)+3(y−2)−2(z−3)0​

只使用於三維空間中, a × b 將會與 a 和 b 互相垂直 (dot product = 0)

a⃗=[a1a2a3],b⃗=[b1b2b3],a⃗×b⃗=[a2b3−a3b2a3b1−a1b3a1b2−a2b1]\vec{a} = \begin{bmatrix} a_1\\a_2\\a_3\end{bmatrix}, \vec{b} = \begin{bmatrix} b_1\\b_2\\b_3\end{bmatrix}, \vec{a} \times \vec{b} = \begin{bmatrix} a_2b_3-a_3b_2 \\ \color{red}{a_3b_1-a_1b_3} \\ a_1b_2-a_2b_1 \end{bmatrix}a=​a1​a2​a3​​​,b=​b1​b2​b3​​​,a×b=​a2​b3​−a3​b2​a3​b1​−a1​b3​a1​b2​−a2​b1​​​
[1−71]×[524]=[−7×4−1×21×5−1×41×2−(−7)×5]=[−30137]\begin{bmatrix} 1 \\-7 \\1 \end{bmatrix} \times \begin{bmatrix} 5 \\2 \\4 \end{bmatrix}= \begin{bmatrix} -7\times4-1\times2 \\ \color{red}{1\times5-1\times4} \\ 1\times2-(-7)\times5 \end{bmatrix} = \begin{bmatrix} -30 \\1 \\37 \end{bmatrix}​1−71​​×​524​​=​−7×4−1×21×5−1×41×2−(−7)×5​​=​−30137​​

Relationship between cross product and sin of angle:

a⃗⋅b⃗=∥a⃗∥∥b⃗∥cos⁡(θ)∥a⃗×b⃗∥=∥a⃗∥∥b⃗∥sin⁡(θ)\begin{aligned} \vec{a} \cdot \vec{b} &= \lVert \vec{a} \rVert\lVert \vec{b} \rVert \cos(\theta) \\ \lVert \vec{a} \times \vec{b} \rVert &= \lVert \vec{a} \rVert\lVert \vec{b} \rVert \sin(\theta) \end{aligned}a⋅b∥a×b∥​=∥a∥∥b∥cos(θ)=∥a∥∥b∥sin(θ)​

a⃗⋅b⃗=∥a⃗∥∥b⃗∥cos⁡θcos⁡θ=adj∥a⃗∥,adj=∥a⃗∥cos⁡θ\vec{a} \cdot \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\cos\theta\\ \cos\theta = \frac{adj}{\lVert\vec{a}\rVert}, adj = \lVert\vec{a}\rVert\cos\thetaa⋅b=∥a∥∥b∥cosθcosθ=∥a∥adj​,adj=∥a∥cosθ
a⃗⋅b⃗=∥b⃗∥×adj\vec{a}\cdot\vec{b} = \lVert\vec{b}\rVert \times adja⋅b=∥b∥×adj
when θ=90∘,a⃗⋅b⃗=∥a⃗∥∥b⃗∥cos⁡90∘=∥a⃗∥∥b⃗∥×0=0when θ=0∘,a⃗⋅b⃗=∥a⃗∥∥b⃗∥cos⁡0∘=∥a⃗∥∥b⃗∥×1=0=∥a⃗∥∥b⃗∥\begin{aligned} &\text{when } \theta = 90^\circ, \vec{a} \cdot \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\cos 90^\circ = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\times 0 = 0 \\ &\text{when } \theta = 0^\circ, \vec{a} \cdot \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\cos 0^\circ = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\times 1 = 0 = \lVert\vec{a}\rVert\lVert\vec{b}\rVert \end{aligned}​when θ=90∘,a⋅b=∥a∥∥b∥cos90∘=∥a∥∥b∥×0=0when θ=0∘,a⋅b=∥a∥∥b∥cos0∘=∥a∥∥b∥×1=0=∥a∥∥b∥​
a⃗×b⃗=∥a⃗∥∥b⃗∥sin⁡θsin⁡θ=opt∥a⃗∥,opt=∥a⃗∥sin⁡θ\vec{a} \times \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\sin\theta\\ \sin\theta = \frac{opt}{\lVert\vec{a}\rVert}, opt = \lVert\vec{a}\rVert\sin\thetaa×b=∥a∥∥b∥sinθsinθ=∥a∥opt​,opt=∥a∥sinθ
a⃗×b⃗=∥b⃗∥×opt\vec{a} \times \vec{b} = \lVert\vec{b}\rVert \times opta×b=∥b∥×opt
when θ=90∘,a⃗⋅b⃗=∥a⃗∥∥b⃗∥sin⁡90∘=∥a⃗∥∥b⃗∥×1=∥a⃗∥∥b⃗∥when θ=0∘,a⃗⋅b⃗=∥a⃗∥∥b⃗∥sin⁡0∘=∥a⃗∥∥b⃗∥×0=0\begin{aligned} &\text{when } \theta = 90^\circ, \vec{a} \cdot \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\sin 90^\circ = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\times 1 = \lVert\vec{a}\rVert\lVert\vec{b}\rVert \\ &\text{when } \theta = 0^\circ, \vec{a} \cdot \vec{b} = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\sin 0^\circ = \lVert\vec{a}\rVert\lVert\vec{b}\rVert\times 0 = 0 \end{aligned}​when θ=90∘,a⋅b=∥a∥∥b∥sin90∘=∥a∥∥b∥×1=∥a∥∥b∥when θ=0∘,a⋅b=∥a∥∥b∥sin0∘=∥a∥∥b∥×0=0​

Plane U=Ax+By+Cz=Dnormal vector n⃗=[ABC]\begin{aligned} \text{Plane } \mathbf{U} &= Ax + By +Cz = D \\ \text{normal vector } \vec{n} &= \begin{bmatrix} A\\B\\C\end{bmatrix} \end{aligned}Plane Unormal vector n​=Ax+By+Cz=D=​ABC​​​

n⃗=[ABC],f=[a0−b0a1−b1a2−b2]\vec{n} = \begin{bmatrix}A\\B\\C \end{bmatrix}, f = \begin{bmatrix}a_0-b_0 \\a_1-b_1\\a_2-b_2 \end{bmatrix}n=​ABC​​,f=​a0​−b0​a1​−b1​a2​−b2​​​
cos⁡θ=d∣f⃗∣,d=∣f⃗∣cos⁡θ\cos\theta = \frac{d}{\lvert\vec{f}\rvert}, d = \lvert\vec{f}\rvert\cos\thetacosθ=∣f​∣d​,d=∣f​∣cosθ
d=∣n⃗∣∣f⃗∣cos⁡θ∣n⃗∣=n⃗⋅f⃗∣n⃗∣=[Aa0−Ab0Ba1−Bb1Ca2−Cb2]A2+B2+C2=Aa0+Ba1+Ca2−DA2+B2+C2\begin{aligned} d &= \frac{\lvert\vec{n}\rvert\lvert\vec{f}\rvert\cos\theta}{\lvert\vec{n}\rvert} = \frac{\vec{n}\cdot\vec{f}}{\lvert\vec{n}\rvert} \\ &= \frac{\begin{bmatrix}Aa_0-Ab_0 \\Ba_1-Bb_1\\Ca_2-Cb_2 \end{bmatrix}}{\sqrt{A^2+B^2+C^2}} = \frac{Aa_0+Ba_1+Ca_2-D}{\sqrt{A^2+B^2+C^2}} \end{aligned}d​=∣n∣∣n∣∣f​∣cosθ​=∣n∣n⋅f​​=A2+B2+C2​​Aa0​−Ab0​Ba1​−Bb1​Ca2​−Cb2​​​​=A2+B2+C2​Aa0​+Ba1​+Ca2​−D​​
d=1⋅2−2⋅3+3⋅1−512+(−2)2+32=2−6+3−51+4+9=−614d = \frac{1\cdot2-2\cdot3+3\cdot1-5}{\sqrt{1^2+(-2)^2+3^2}} =\frac{2-6+3-5}{\sqrt{1+4+9}}=\frac{-6}{\sqrt{14}}d=12+(−2)2+32​1⋅2−2⋅3+3⋅1−5​=1+4+9​2−6+3−5​=14​−6​

現在有一平面方程式為 Ax−2y+z=d還有另一平面包含兩條線 x−12=y−23=z−34 和 x−23=y−34=z−45並且兩個平面為平行的,且距離為6請求出 ∣d∣\text{現在有一平面方程式為 } Ax - 2y + z = d \\ \text{還有另一平面包含兩條線 } \frac{x-1}{2}=\frac{y-2}{3}=\frac{z-3}{4} \text{ 和 } \frac{x-2}{3}=\frac{y-3}{4}=\frac{z-4}{5}\\ \text{並且兩個平面為平行的,且距離為} \sqrt{6} \\ \text{請求出 } \lvert d \rvert現在有一平面方程式為 Ax−2y+z=d還有另一平面包含兩條線 2x−1​=3y−2​=4z−3​ 和 3x−2​=4y−3​=5z−4​並且兩個平面為平行的,且距離為6​請求出 ∣d∣
a=(1,2,3) and b=(3,5,7) from the first linec=(2,3,4) from the second linea⃗=b−a=2i+3j+4kb⃗=c−a=i+j+ka⃗×b⃗=∣ijk234111∣=−i+2j−k=n⃗\begin{aligned} &a= (1,2,3) \text{ and } \\&b=(3,5,7) \text{ from the first line} \\ &c= (2,3,4) \text{ from the second line} \\\\ &\vec{a} = b-a = 2i+3j+4k\\ &\vec{b} = c-a = i+j+k\\\\ &\vec{a} \times \vec{b} = \begin{vmatrix} i &\color{red}{j}&k\\2&3&4\\1&1&1 \end{vmatrix} = -i+2j-k =\vec{n} \end{aligned}​a=(1,2,3) and b=(3,5,7) from the first linec=(2,3,4) from the second linea=b−a=2i+3j+4kb=c−a=i+j+ka×b=​i21​j31​k41​​=−i+2j−k=n​
c⃗=(x−1)i+(y−2)j+(z−3)kn⃗ =−i+2j−kn⃗×c⃗=0−x+1+2y−4−z+3=0−x+2y−z=0x−2y+z=0\begin{aligned}\vec{c} &= (x-1)i+(y-2)j+(z-3)k \\ \vec{n}\ &= -i+2j-k\\ \vec{n} \times \vec{c} &= \mathbf{0} \\\\ -x+&1+2y-4-z+3=0\\ -x+&2y-z=0\\ x-&2y+z=0 \end{aligned}cn n×c−x+−x+x−​=(x−1)i+(y−2)j+(z−3)k=−i+2j−k=01+2y−4−z+3=02y−z=02y+z=0​
Ax−2y+z=d⇒   x−2y+z=d\begin{aligned} &Ax-2y+z=d \\ \Rightarrow &\,\,\,x-2y+z=d \end{aligned}⇒​Ax−2y+z=dx−2y+z=d​
distance=2⋅1−3⋅2+4⋅1−d12+(−2)2+126=−d6d=−6∣d∣=6\begin{aligned} \text{distance} &= \frac{2\cdot1-3\cdot2+4\cdot1-d}{\sqrt{1^2+(-2)^2+1^2}} \\ \sqrt{6} &= \frac{-d}{\sqrt{6}}\\ d & =-6 \\ \lvert d \rvert &= 6 \end{aligned}distance6​d∣d∣​=12+(−2)2+12​2⋅1−3⋅2+4⋅1−d​=6​−d​=−6=6​
https://youtu.be/rVQ3G9epCjw
https://youtu.be/r2PogGDl8_U
https://youtu.be/PsNidCBr5II
https://youtu.be/5AWob_z74Ks
平面的 equation
Cross Product
https://youtu.be/7MKA2QlKvHc
https://youtu.be/tdwFdzVqito
https://youtu.be/gw-4wltP5tY
https://youtu.be/7rIFO8hct9g
https://youtu.be/v8plb6V8BQo