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?

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

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

Start your 7-day free trial
DJ_AM_JuiceboxAuthor Commented:
ozo, could you just show me how I would apply an angle rotation once?

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?

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

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:
Jose ParrotGraphics ExpertCommented:

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?

We need more info.

Jose ParrotGraphics ExpertCommented:
Are your cosines not a table, but a matrix instead?
In such case, it is a matrix transformation very usual in computer graphics.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.