设a,b的夹角为θ
|a + tb|² = (a + tb)(a + tb)
= |a|² + t²|b|² + 2t(a •
b)
= |a|² + t²|b|² + 2t * |a||b|cosθ
= |b|²t² + 2(|b|t)(|a|cosθ) +
(|a|cosθ)² - (|a|cosθ)² + |a|²
= (|b|t + |a|cosθ)² + |a|²(1 - cos²θ)
=
|b|²(t + |a|/|b| * cosθ)² + (|a|sinθ)²
当t = - |a|/|b| * cosθ = - (a • b)/|b|²
时取得最小值