Re: [Algorithms] decompose onto non-orthogonal vectors
Brought to you by:
vexxed72
From: Will P. <wi...@cs...> - 2000-07-15 02:41:27
|
> how to you get scalars (u,v) such that u*a + v*b = p? > Ie. decompose p onto a and b. Regardless of what the answer is, you have one equation (ua + vb = p) and two unknowns (u and v). You need to come up with an equation involving u and/or v that is linearly independent of the first equation, and then you can solve the system of linear equations. You could make up something like: u + v = 1, which is the same as v = 1 - u and then substitute in to the first equation: ua + vb = p ua + (1 - u) b = p ua - ub = p - b u = (p - b) / (a - b) and then v = 1 - u... assuming I didn't make any mistakes in this textual algebra, which is hard for me to write (and I imagine hard to read). the thing is, this made-up equation (u + v = 1) doesn't guarrantee a positive u and positive v. so I hope you weren't looking for that. :) the other problem is you have to make sure vector a and vector b are linearly independent, or there is likely to be no solution, no matter what u, v, and the second equation is. Will |