Section02 Lengths and Dot Products
Dot Product
Defination
Properties
- when the result of dot product is zero, the two vectors are perpendicular.
Application
- Business
Length and Unit Vectors
Length
Unit Vectors
Properties
- is a unit vector. (极坐标)
- is the unit vector in the same direction as .
The Angle Between Two Vectors
Proof: when , and are perpendicular.
Proof: If , then
From dot product to angle
- When the result of dot product is positive, the angle between two vectors is less than 90 degrees.
- When the result of dot product is negative, the angle between two vectors is greater than 90 degrees.
- The borderline is the zero. where the angle is 90 degree.
Calculating the cosine of angle between two vectors
- Unit Vectors and at angle have . Certainly
- 当两个单位向量点乘时,点乘的结果为两个单位向量夹角的余弦值。
- If and are nonzero vectors, then
Properties
Schwarz Inequality
- proof
Triangle Inequality
proof
根据定义,三角形两边之和大于第三边
Computing In Programing
-
# This is a Julia Example v = [1,2,3]; w = [4,5,6]; # v cdot w v' * w; Angle Computing
# This is a Julia Example using LinearAlgebra v = [1,2,3]; w = [4,5,6]; cosine = (v' * w) / (norm(v) * norm(w)) theta = acos(cosine)