de-CH
utf-8
math math-format kvector
Calculate Coordinate Vector with ONB
la-03-01
multiple
419904
randRange(-4,4) randRangeExclude(-4,4,[A]) randRange(-4,4) randRange(-4,4) randRangeExclude(-4,4,[D]) randRange(-4,4)
A B C D E F VY*WZ-VZ*WY VZ*WX-VX*WZ VX*WY-VY*WX randRangeExclude(-8,8,[0,A,B]) randRangeExclude(-8,8,[0,C,D]) randRangeExclude(-8,8,[I])

Given v = \begin{pmatrix}X \\ Y \\ Z \end{pmatrix} and a basis \mathcal B = \left\{ \begin{pmatrix} A \\ B\\ C\end{pmatrix}, \begin{pmatrix} D \\ E\\ F\end{pmatrix}, \begin{pmatrix} G \\ H\\ I\end{pmatrix} \right\}.

Calculate the coordinate vector [v]_{\mathcal B} = \begin{pmatrix} {\color{red}X} \\ {\color{blue}Y} \\ Z \end{pmatrix} of v with respect to the basis \mathcal B .

a \color{red} X = kvector.dot([A,B,C],[X,Y,Z])/ kvector.dot([A,B,C],[A,B,C])
b \color{blue} Y = kvector.dot([D,E,F],[X,Y,Z])/ kvector.dot([D,E,F],[D,E,F])
c Z = kvector.dot([G,H,I],[X,Y,Z])/ kvector.dot([G,H,I],[G,H,I])

We looking for {\color{red}X}, {\color{blue}Y} and Z to form the unique solution of the system of linear equations \begin{pmatrix}X \\ Y \\ Z \end{pmatrix} = {\color{red}X} \begin{pmatrix} A \\ B \\ C\end{pmatrix} + {\color{blue}Y} \begin{pmatrix} D \\ E\\ F\end{pmatrix} + Z \begin{pmatrix} G \\ H\\ I\end{pmatrix}.

This can be done either using Gaussian elimination or with the matrix A= \begin{pmatrix} A & D & G \\ B & E & H \\ C & F & I\end{pmatrix}

or the Euclidean scalar product (SCP), as the three basis vectors are orthogonal with respect to this SCP - verify this!

To determine {\color{red}X} we apply the SCP with \begin{pmatrix} A \\ B\\ C\end{pmatrix} on both sides of the equation and get

\begin{pmatrix} A \\ B\\ C\end{pmatrix} \cdot \begin{pmatrix}X \\ Y \\ Z \end{pmatrix} = kvector.dot([A,B,C],[X,Y,Z]) = \begin{pmatrix} A \\ B\\ C\end{pmatrix} \cdot \left( {\color{red}X} \begin{pmatrix} A \\ B \\ C\end{pmatrix} + {\color{blue}Y} \begin{pmatrix} D \\ E\\ F\end{pmatrix} + Z \begin{pmatrix} G \\ H\\ I\end{pmatrix}\right).

Due to the bilinearity of the SCP and the orthogonality of the basis, only the right-hand side remains

{\color{red}X} \begin{pmatrix} A \\ B\\ C\end{pmatrix} \cdot \begin{pmatrix} A \\ B \\ C\end{pmatrix} = {\color{red}X} \cdot negParens(kvector.dot([A,B,C],[A,B,C])).

Thus, together we have:

{\color{red}X} = fractionReduce(kvector.dot([A,B,C],[X,Y,Z]), kvector.dot([A,B,C],[A,B,C])).

For the other two coordinates, we then use the respective basis vector.

We get

{\color{blue}Y} = fractionReduce(kvector.dot([D,E,F],[X,Y,Z]), kvector.dot([D,E,F],[D,E,F])) and Z = fractionReduce(kvector.dot([G,H,I],[X,Y,Z]), kvector.dot([G,H,I],[G,H,I])).