Re: [Algorithms] decompose onto non-orthogonal vectors
Brought to you by:
vexxed72
From: Will P. <wi...@cs...> - 2000-07-15 03:08:11
|
I prefer this answer to mine from a theory standpoint, because it expresses all of the gotchas that I had to list explicitly... code wise, I wouldn't want to actually make a matrix to solve it (i'm sure you wouldn't either). One thing I didn't mention, and I haven't proven it to myself mathematically yet: if vectors a and b are linearly independent (which they don't seem to be from the original thread author's drawing), then there's only one solution for u and v. For example, in the "normal" orthonormal basis that we use ((1,0,0)(0,1,0)(0,0,1), there's only one linear combination of the basis that will give a point p. i'm assuming the basis vectors span the subspace for those mathematically inclined people who want to jump on me. :) Will ---- Will Portnoy http://www.cs.washington.edu/homes/will On Fri, 14 Jul 2000, Jonathan Blow wrote: > "Discoe, Ben" wrote: > > > > I thought it would be a simple problem, but all usual sources failed to > > answer, so perhaps it will be obvious to someone on this list. > > > > Given a point p and two unit vectors a and b like this: > > > > b > > / > > v/----p > > / / > > / / > > / / > > ---------a > > u > > > > how to you get scalars (u,v) such that u*a + v*b = p? > > Ie. decompose p onto a and b. > > This is one of those "fundamental linear algebra things" > that Ron and I were just talking about. > > Your original coordinates of 'p' are in the coordinate > system that we are used to, that is, two basis vectors > that are orthonormal. We will call this space R. > > You want the coordinates of 'p' in a system in which > the vectors are unit, but not orthogonal. We will call > this space S. > > Just build a transformation matrix from R to S, and > call that matrix T. Then p' = Tp and you are done. > > For instructions on how to make a matrix that goes from > one space to another, given the basis vectors of each > space, consult any one of a trillion graphics books. > > -J. > > > > I promise i consulted an academic > > What kind of academic was that? > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |