Vector Decomposition: Finding Components w/ Vector Math

  • Context: Undergrad 
  • Thread starter Thread starter _Nate_
  • Start date Start date
  • Tags Tags
    Decomposition Vector
Click For Summary

Discussion Overview

The discussion revolves around the decomposition of a large vector into components that are parallel and perpendicular to a given unit vector in three-dimensional space. Participants explore methods to achieve this using vector mathematics, particularly focusing on avoiding computationally expensive trigonometric functions.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant describes the need to decompose a large vector into components along and perpendicular to a unit vector, seeking a method that avoids expensive trigonometric calculations.
  • Another participant outlines a mathematical approach using vector projection and the Gram-Schmidt process, providing formulas for the components.
  • A different participant questions whether the original query is homework-related and suggests that vector math is more efficient than trigonometric functions.
  • One participant clarifies that their work is for a physics simulator and emphasizes the desire to improve efficiency by reducing reliance on trigonometric functions.
  • Another suggestion is made to use Taylor polynomials to approximate trigonometric functions for faster computation.
  • A participant recommends storing vectors in their component form (x, y, z) to facilitate decomposition and only converting to magnitude when necessary.
  • A later reply acknowledges the suggestion about component storage but emphasizes that the decomposition is about an arbitrary vector, not aligned with the coordinate axes.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to vector decomposition, with some advocating for vector math over trigonometric functions, while others suggest approximations or alternative methods. The discussion remains unresolved regarding the optimal method for implementation.

Contextual Notes

Participants note potential accuracy loss when using certain methods, and there are references to specific mathematical processes and computational strategies that may depend on the context of the application.

_Nate_
Messages
19
Reaction score
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
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].<br /> Let [itex]\vec{W}[/itex] be the component vector of V orthogonal to [itex]\vec{u}[/itex]<br /> <br /> Thus, we have:<br /> [tex]\vec{V}=U\vec{u}+\vec{W}[/tex]<br /> Taking the dot product here with [itex]\vec{u}[/itex], we gain:<br /> [tex]\vec{V}\cdot\vec{u}=U[/tex]<br /> since u was orthogonal to W and of magnitude 1.<br /> <br /> Hence, going back, the orthogonal component of V thereby obeys:<br /> [tex]\vec{W}=\vec{V}-(\vec{V}\cdot\vec{u})\vec{u}[/tex]<br /> <br /> This is called the Gram-Schmidt orthogonalization process of vectors (or something like that)[/itex]
 
Last edited:
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.
 
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.
 
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).
 
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.
 
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.
 

Similar threads

Replies
26
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
4K
  • · Replies 50 ·
2
Replies
50
Views
5K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 14 ·
Replies
14
Views
3K