# Program to find Orthogonal Matrices

I have been trying to find orthogonal matrix of order n where first row will be given as 1/√n, 1/√n, .... n times.

The second row will be a vector such that dot product of it with the row above and below will be zero and so on. Means, in a matrix of order 3, the 3rd row will be the cross product of first 2 rows.

How do I approach such a problem?

• Hi "Doctor", you asked a fine question, but it contained some parts which are off-topic for this site. So I removed those parts to prevent the question to be closed by the community. If you need answers for implementation details, ask at www.stackoverflow.com (but avoid to ask the same question on PSE an SO). Commented Nov 18, 2014 at 12:42

Extend the given row vector with n-1 vectors forming a set of n linear independent vectors. For example,

(1,0,0,...,0,0),
(0,1,0,...,0,0),
...
(0,0,0,...,1,0),


should be sufficient. Afterwards, you apply the Gram-Schmidt process to these vectors. Since Gram-Schmidt keeps the first vector unchanged, the result will be n orthogonal row vectors, forming the orthogonal matrix you are looking for.