MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Generating Two Unit Orthogonal Vectors

  • To: mathgroup at
  • Subject: [mg36426] Re: Generating Two Unit Orthogonal Vectors
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Fri, 6 Sep 2002 03:16:58 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hugh Goyder and David Park gave a most elegant function to find two vectors
that are orthogonal to one vector in 3D.  The key to coming up with the
elegant solution is an understanding of Mathematica's NullSpace function.
We can easily make the version from Hugh and David much more general with
the version below.

The version above will give a set of unit orthogonal vectors if given any
number of vectors in any dimension.  
So besides giving it a 3D vector we can give it the following:

But the short version above isn't very robust.
(1)  Clear[x,y,z];NullSpace[{{x,y,z}}]
       returns two vectors orthogonal to {x,y,z}, but the two vectors
NullSpace returns aren't orthogonal to each other. 
       So (OrthogonalUnitVectors) should only work with numeric vectors.

(2)  We should ensure all the vectors have the same dimension and length >1.

I give a less concise version below that corrects these problems.


   Ted Ersek
   Get Mathematica tips, tricks from

  • Prev by Date: RE: Re: Generating Two Unit Orthogonal Vectors to a 3D Vector
  • Next by Date: Re: Resizing Graphics
  • Previous by thread: RE: Re: fourier transform time
  • Next by thread: RE: Generating Two Unit Orthogonal Vectors