I first make a function to get a random vector on unit sphere in a swath around the equator. That is what the parameter $\gamma$ controls; if $\gamma = 1/2$, the vectors can be chosen anywhere on the sphere; if $\gamma = 0$, the vectors can only be chosen from the equatorial plane etc.

The $u_2$ vectors are concentrated at the equator but there is a sizable number that are spreadout over the sphere. I would expect to get something that looked just like $u_1$ instead.

The initial vectors $v_1$ and $v_2$ lie in the same 'swath' as $u_1$ so I know that it is the G-S process that is failing.

I have looked at some of the culprit points and have noticed that their initial starting vectors were near parallel. I think this is the cause of the problem. I tried increasing WorkingPrecision when I call RandomReal but that did not seem to have any noticeable effect. Is there a way I can fix this problem?

1 Answer
1

I'm not sure why you'd expect the resulting vectors to remain in the original swath because you're forcing the angle between the two resulting vectors to be 90 deg. Pairs of vectors with cross products far from the poles of the sphere will necessarily result in one of the vectors "popping out" of the swath.

I'd also like to point out that you don't need Gram-Schmidt to create an orthonormal basis for the two vectors. Instead, you can just do the following: Given two vectors v1 and v2, define u1=v1 then construct u2=Normalize[v1 x v2]. Finally, u3 = u2 x u1. Now u1 will be aligned with v1 and u3 will be in the plane defined by v1 and v2 but it will be orthogonal to u1 and in the general direction of v2.

You could also construct a basis by using Orthogonalize[{v1,v2, Cross[v1,v2]}]
–
HeikeFeb 3 '12 at 21:11

ok, I see my error. I did not visualize how the basis vectors could get to the poles but now I see. For my situation I want the basis vectors to remain in the swath. Should I delete this question and ask a new one or modify this one?
–
BeauGesteFeb 3 '12 at 23:10

1

Generally you don't delete a question unless it's seriously terrible (and this is not). I'd just ask a new question.
–
David ZFeb 4 '12 at 3:23

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.