Finding Angle Around Vector

Started by
4 comments, last by The Frugal Gourmet 20 years, 5 months ago
Quick Question: I have a certain vector and certain rotation matrix. I want to determine the angle an object is rotated around that particular vector. How do I do it? Thanks in advance.
Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.
Advertisement
If u have 2 vectors, angle between them can be worked out via dot product:

(Where a & b are vectores)

a dot b = |a||b|cos g

where g is the angle between them

thats a good starting point...

(carteasient equation is: x1x2 + y1y2 + z1z2 = |a| |b| cos g
where x1 is x component of vector a and x2 is x component of vector b etc...)

(I assume u can work out a vector to describe you objcets new and old position relative to some point...)

----------------

Does it matter? Even if it does matter, does it matter that it matters?
---------Does it matter? Even if it does matter, does it matter that it matters?
Hmm.. thanks for responding. I''m not sure I understand, though.

Let''s say I have a space ship traveling in a certain vector. Let''s assume the space ship is rotated AROUND that vector arbitrarily (maybe 45 degrees or something).

I have the vector and the current rotation matrix, but I actually want to find out what that angle the ship is "rolled" around that vector (conceptually). For some reason, I can''t figure that out.
Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.
Actually, a more simple way of putting it...

I guess what I''m saying is:

Can I convert from a euler angle representation (yaw, pitch, roll) to an axis/angle representation?

If so, what is the formula?

Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.
One way I can think about doing it... (its a bit screwie though):

Before the role, find the normal the the plane you are traveling along, after the roll, do that again, dot the two to find the angle between them...


OR:

If you know the pitch, yaw & roll, the angel you rotate around is the roll...
(correct me if i''m wrong..)

i.e. your direction vector is define only by pitch and yaw
(2 angles needed for any direction in 3d space)

The roll is your rotation about the direction vector...
(if that makes any sense at all...)


-----------

Does it matter? Even if it does matter, does it matter that it matters?
---------Does it matter? Even if it does matter, does it matter that it matters?
I realize this is a belated response, but thank you very much!
Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.

This topic is closed to new replies.

Advertisement