Hello, Raman!
There are formulas for this problem . . .
Express the vector: .A .= .2i - 3j + 5k .as a sum .A .= .B + C,
where B is parallel to the vector V .= .3i - 2j + 5k, and C is perpendicular to V. Code:
*
A * :
* : C
* :
*---------------+-------*
: - - - B - - - :
: - - - - - V - - - - - :
Given vectors A and V . . . B is the projection of A onto V.
. . . . . . . . . . . . . . . . .A·V
The formula is: .B . = . ----- V
. . . . . . . . . . . . . . . . .|V|²
. . . . . . . . . . . . . . .[2,-3,5]·[3,-2,5] . . . . . . .37
So we have: .B . = . --------------------- V . = . --- V
. . . . . . . . . . . . . . .(√3² + 2² + 5²)² . . . . . .38
Hence: .B .= .(37/38)[3,-2,5] .= .[111/38, -74/38, 185/38]
Another formula: . C .= .A - B
Hence: .C .= .[2, -3, 5] - [111/38, -74/38, 185/38] .= .[-35/38, -40/38, 5/38]
Therefore: .A .= .[111/38, -74/38, 185/38] + [-35/38, -40/38, 5/38]