Re: [Algorithms] decompose onto non-orthogonal vectors
Brought to you by:
vexxed72
From: Peter D. <pd...@mm...> - 2000-07-16 12:11:36
|
> >This works for any number of dimensions. Whenever a solution exists, the (u, > >v) pair determined by this approach will have the property u * a + v * b = > >p. (Easy to prove.) > > Agree that it works for any number of dimensions provided that p does > indeed lie in the plane of a and b. My point was that it will not > detect the case that p does not lie in that plane, that is, will not > detect the case that no solution exisits. Hmm, it must be my English. :) 1. Find the (u, v) pair as above. 2. Check whether u * a + v * b = p. 3. If yes, this (u, v) pair is the solution. 4. If no, no solution exists. So it does indeed detect whether p lies in the plane formed by a and b. Whenever p lies in that plane, an (u, v) pair such that p = u * a + v * b must exist, and vice versa. (I'm deliberately assuming that this plane is unique. Nevertheless, the method "works" even if a and b are collinear, or one of them is zero.) A more "formal" proof: First, assume that a solution does exist, i.e. there exists an (u0, v0) pair such that u0 * a + v0 * b = p. Such a pair must satisfy the linear system of equations I gave, and therefore can be determined by solving that system. If this pair is unique (the case we are interested in,) it will be the only solution of this system (*), and therefore will have the property u * a + v * b = p. Now, assume that no solution exists, i.e. no (u, v) pair satisfies u * a + v * b = p. In this case, obviously, whatever the solution of the system, it cannot have this property. QED? -- Peter Dimov Multi Media Ltd. (*) The determinant is zero when a.a * b.b = a.b * b.a, i.e. when a and b are collinear. P.S. I'm inclined to note that this method does not even mention coordinates, relying only on the fact that multiplication, addition, and dot product are defined on a, b, and p, and therefore you must like it, by definition. :) |