Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2011-04-02 05:53:28

safra
Member
Registered: 2005-12-03
Posts: 41

### Change the direction of a vector by another vector

Hi,

I have a Vector A (xyz) and another vector B (xyz). Let's say A becomes a "child" of B and inherits the B direction as the origin. How can I get the new direction of A based on its old direction and the direction B is pointing at?

Sorry for the poor explanation, I don't know the right wording for this which also makes it hard to search for the solution. I have read about matrices etc. but no luck so far.

Thanks!

Offline

## #2 2011-04-04 00:42:07

safra
Member
Registered: 2005-12-03
Posts: 41

### Re: Change the direction of a vector by another vector

I guess I meant how to rotate an existing vector according another vector?

I have been reading about quaternions, cross products, eulerAngles etc, still confused on how to do this?

Anyone who knows how to do this?

Offline

## #3 2011-04-05 00:18:41

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

### Re: Change the direction of a vector by another vector

Hi safra;

Any of this useful to you? It is horribly formatted but...

http://steve.hollasch.net/cgindex/math/rotvec.html

In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline