#L02 · Linear Algebra & Manifolds · Lv.2View in 3D Mind-Map
Dot Product & Cosine Similarity
J. W. Gibbs & Oliver Heaviside · 1881 CE
Equates simple component-wise multiplication ∑ a_i b_i with geometric angle alignment ‖a‖‖b‖cos θ—powering LLM RAG vector search, Transformer Attention, and 3D lighting shaders.
🧮 Live Formula Calculator & Plotter
Vec a_x
Vec a_y
Vec b_x
Vec b_y
내적 a · b
16.000
코사인 유사도 cos θ
0.8000
두 벡터 사잇각 θ
36.9°
Prerequisite Path (10 STEP)
Full Path AnalyzerClick steps in order to follow the 3D neon path from basics to target.
STEP 1#A01Linear Equation & Balance Axiom
STEP 2#A02Polynomial Expansion & Factoring
STEP 3#A03Laws of Exponents & Radicals
STEP 4#G03Pi, Radian Measure & Circular Sector
STEP 5#G01Pythagorean Theorem
STEP 6#L01Vector Operations, L1/L2 Norms & Normalization
STEP 7#G04Unit Circle Trigonometry & Identities
STEP 8#G022D/3D Euclidean Distance Formula
STEP 9#G05Law of Sines & Law of Cosines
STEP 10#L02Dot Product & Cosine Similarity
Geometric & Intuitive Insight
두 벡터가 같은 방향(0°)을 바라보면 cos θ = 1 (유사도 최대), 수직(90°)이면 내적이 0 (무관함/직교), 반대 방향(180°)이면 -1 이 됩니다. 게임에서 적이 내 시야각 안에 있는지, 태양빛이 표면에 얼마나 수직으로 비치는지 단 한 줄로 판별합니다!
Step-by-Step Derivation
- Step 1.1단계: 두 벡터 a, b와 차이 벡터 (a - b)가 이루는 삼각형에 제2코사인법칙을 적용합니다 → ‖a - b‖² = ‖a‖² + ‖b‖² - 2‖a‖‖b‖cos θ
- Step 2.2단계: 좌변을 성분별로 전개하면 ∑(a_i - b_i)² = ∑a_i² + ∑b_i² - 2∑a_i b_i 입니다.
- Step 3.3단계: 양변의 ‖a‖² + ‖b‖² 을 소거하고 -2로 나누면 ∑ a_i b_i = ‖a‖‖b‖cos θ 가 완벽히 증명됩니다.
AI & Coding Real-World Use
LLM Transformer Attention (Q·K^T), RAG vector DB cosine search, and 3D Lambertian lighting (N·L)
#LLM Self-Attention Q·K#RAG Vector DB#3D Lighting Shader
const cosSim = (a:number[], b:number[]) => dot(a,b) / (norm(a) * norm(b));Linear Algebra & Manifolds — Related Formulas in This Cluster
Vector Operations, L1/L2 Norms & Normalization
Lv.1 · L1/L2 Regularization
3D Cross Product & Surface Normal Vector
Lv.2 · 3D Surface Normal
Matrix Multiplication & Linear Transformation
Lv.2 · GPU Tensor Cores GEMM
Determinant & Matrix Inverse
Lv.3 · 3D Mouse Raycasting
Gaussian Elimination & Linear Systems (Ax = b)
Lv.2 · Linear Solver Ax=b
2D/3D Rotation Matrix & Orthogonal Group SO(3)
Lv.3 · 3D Engine Rotation