We will begin with a rectangular matrix A, and we will be able to solve this system by decomposing A into an orthogonal matrix Q and an upper triangular matrix R (using QR decomposition), i.e A = QR.
We will first convert the columns of the matrix A into Vectors. Then, for each vector ak, we will calculate the vectors uk and ek given by
ek = uk / ||uk||
Q = [e1, ..., en] and