Vector Decomposition: Finding Components w/ Vector Math

In summary, the conversation discusses the decomposition of a large vector into components in the direction and perpendicular to a given unit vector. It suggests using vector math instead of trigonometric functions for efficiency. The Gram-Schmidt orthogonalization process is mentioned as a possible method. Suggestions are also made to store vectors as x, y, and z components and to use Taylor polynomials to approximate trigonometric functions for faster calculations.
  • #1
_Nate_
20
0
I'm doing some work with vectors, and essentially, I have two vectors: a large vector and a unit vector pointing in a different direction. I would like to decompose the large vector into the components that are in the direction of and perpendicular to the unit vector.

This is in three dimensions, and shouldn't be too hard using cos and acos. However, this is for some computer work, where cos and acos are expensive -- is there any better way to do this using purely vector math (such as cross product, etc) or some other method not quite so expensive?
 
Physics news on Phys.org
  • #2
Let your vector be called [itex]\vec{V}[/itex] Let [itex]\vec{u}[/tex] be your given unit vector, U being the projection of [itex]\vec{V}[/itex] on [itex]\vec{u}[/itex].
Let [itex]\vec{W}[/itex] be the component vector of V orthogonal to [itex]\vec{u}[/itex]

Thus, we have:
[tex]\vec{V}=U\vec{u}+\vec{W}[/tex]
Taking the dot product here with [itex]\vec{u}[/itex], we gain:
[tex]\vec{V}\cdot\vec{u}=U[/tex]
since u was orthogonal to W and of magnitude 1.

Hence, going back, the orthogonal component of V thereby obeys:
[tex]\vec{W}=\vec{V}-(\vec{V}\cdot\vec{u})\vec{u}[/tex]

This is called the Gram-Schmidt orthogonalization process of vectors (or something like that)
 
Last edited:
  • #3
Before I give you the answer, is this homework, and what have you done? This is much easier with vector math than trig functions; in fact you will have to pretty much solve the problem using vector math before you can even start using trig functions.

EDIT:
Never mind. Arildno already gave the answer.
 
  • #4
No, it's not homework -- I'm working on a physics simulator just for fun. I had already had it implemented, as I said, but my implementation was using lots of trig functions, which are expensive. I was pretty sure that there was a better way, though.
 
  • #5
Then I would suggest writing Taylor polynomials to approximate the trig functions. If you really want it fast you might write them in assembly language (although I believe with modern compilers you don't really save much by going to assembly language).
 
  • #6
I have a small suggestion. Store the vectors in the form of the three x,y,z components, as you will have to decompose them anyways to do most of the math. Only convert them into the magnitude when needed (energy calculations, status display...) using Pythogeran Theorem.

That is what I do in my homebrew vector library.
 
  • #7
To HallsofIvy: This is quite a good idea, although it does suffer some accuracy loss. A far better way to do it is in the first reply to this topic. This can be done via other math (namely, the dot product) without ever touching trig functions.

To kkrizka: I do store my vectors as x, y, and z components. However, my decomposition is about an arbitrary vector, not about the x, y, or z axes.
 

What is vector decomposition?

Vector decomposition is the process of breaking down a vector into its individual components using vector math.

Why is vector decomposition important in science?

Vector decomposition allows scientists to analyze the direction and magnitude of a vector separately, making it easier to understand and manipulate complex systems.

How is vector decomposition used in physics?

In physics, vector decomposition is used to break down forces into their horizontal and vertical components to accurately calculate their effects on an object.

Can vector decomposition be applied to non-physical concepts?

Yes, vector decomposition can be applied to many non-physical concepts, such as analyzing the different components of a stock market index or breaking down a chemical reaction into its individual steps.

Are there any limitations to vector decomposition?

Vector decomposition can only be used for vectors that can be represented in a two or three-dimensional space. It also assumes that the vector is a straight line and does not account for any curvatures.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
5
Views
551
  • Advanced Physics Homework Help
Replies
0
Views
546
  • Introductory Physics Homework Help
Replies
13
Views
583
  • Calculus
Replies
2
Views
1K
Replies
14
Views
1K
Replies
10
Views
711
Replies
3
Views
3K
Replies
1
Views
1K
  • Calculus
Replies
5
Views
946
Back
Top