# rotation of a vector

Hi everyone,

I have a bizarre image system where for an image, I get the cosines of the upper left pixel to the world coordinate system. These values are describing the direction of the columns and rows to the world coordinate system. I guess it's like trying to describe the direction of the upper edge and left edge of a plane in 3D space.

For example, I have a sample image with cosines of:

cols: 0/0/-1

rows: 0/1/0

which means the columns of the image are running down the negative z axis, and the rows are running up the positive y axis.

My question is, how could I figure out the resulting cosine direction would be if I apply an arbitrary rotation to the columns for example? If I apply a 90 degree rotation around some axis, what would the cols cosine turn out to be?

Thanks
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
ozo, could you just show me how I would apply an angle rotation once?

Thanks
Commented:
Hi DJ_AM_Juicebox,

Do you have a 2D-game and a fixed rotation-axis, like the z-axis? or is your rotation axis any axis in
3D-space, even everything else than x,y or z-axis?
If so, how do you store the rotation & its axis? Euler-Angles, Axis-Angle or Quaternions?

ike
Commented:
I highly recommend ozo's link for you too! Also make sure to understand rotation and its axis and
how we can store and calculate it:

http://www.euclideanspace.com/maths/geometry/rotations/
Graphics ExpertCommented:
Hi,

Can you describe the image system you are reffering to?
I never saw a rotation defined just by cosines of angles.
The rotations are defined by angles. We use sin and cos of such angles to calculate the position of points around a given point (2D rotation) or around axis (3D rotation) or around an arbitrary line (also 3D rotation).

We can use matrix calculation or formulas to calculate the position of graphic entities after the rotation.
I don't remember if I had ever saw an image rotation defined by cosines in rows and collums. Which rows and cols? Is it a table? Are you sure is that an image? Which image? A bitmap? What are the entries and outputs in the system?