Linear Algebra and the C Language/a0ad
Dot Product
In mathematics, the dot product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors), and returns a single number.... Wikipedia: Dot product
The function
- Dot product ....................................... : dot_R(u,v); ... ... ... Code
- Norm ................................................ : norm_R(u); ... ... ... Code
- Normalise a vector ........................... : smul_mR(1/norm_R(u),u,n_u);
- The distance between two vectors ... : dist_R(u,v); ... ... ... Code
- The projection of u onto v................... : proj_mR(u,v,projuv); ... ... ... [ <u,v> / ||v||^2 ] * v ... ... ... Code
- Properties of (u - projuv) ................... : <v, u - projuv> = -0.000000
Normalize a matrix : (The Orth matrix must be orthogonal)
- Method 1) .......................................... : Normalize_mR(Orth); ... ... ... ... ... ... ... .... Code
- Method 2) .......................................... : normalize_mR(Orth,Orth_Normal); ... ... ... Code
- Method 3) .......................................... : orth_mR(U,Orth,YES); ... ... ... ... ... ... ... ... Code : Gram-Schmidt algorithm