Hey guys, say you have a 2-dimensional vector (x/z), and a vector (1,0). How do you determine the clockwise rotation of the XZ Vector from the other in percent, 0% being 0 degrees and 100% being 360 degrees?

I need to figure this out in the next half hour and can't remember how to do this.
Use the rotation matrix with the correct angle I believe.
The content of this signature is pretty much irrelevant
You put a stick in your bum and you whistle. You whistle LOUD.
DO IT.

Sorry i don't know how to do this stuff yet
Quote by rock.freak667
Use the rotation matrix with the correct angle I believe.

What?

Just find the angle with trig and multiply it by 100/360.
Quote by MakinLattes
What?

Just find the angle with trig and multiply it by 100/360.

Quote by Carmel
I can't believe you are whoring yourself out like that.

ಠ_ಠ
Quote by MakinLattes
What?

Just find the angle with trig and multiply it by 100/360.

My bad, I thought he wanted to rotate (x,y) to some other point. But yes, trig will do it.
The content of this signature is pretty much irrelevant
It just sounded like unit conversion to me.
Well, to find the vector of an angle, the formula is (cos(a), sin(a)) with a being the angle from (1,0). Now how do I get the reverse out of this?

EDIT: I just realised this only works with vectors that have a length of 1.
Last edited by CoreysMonster at Nov 29, 2011,
Quote by CoreysMonster
Well, to find the vector of an angle, the formula is (cos(a), sin(a)) with a being the angle from (1,0). Now how do I get the reverse out of this?

EDIT: I just realised this only works with vectors that have a length of 1.

What exactly are you trying to do? Are you trying to compute the angle between (1,0) and some arbitrary unit vector? Are you trying to find a rotation that maps (1,0) to the position of some arbitrary unit vector?

To do your % conversion, simply multiply your angle in degrees by the constant (100%/360°=0.2777...%/° . The degrees will cancel and you're left with a percentage.

Also, there is a helpful thread, where this might reach more people willing to help out https://www.ultimate-guitar.com/forum/showthread.php?t=658547
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Wait a few months while I go back to school and then have an answer to that question.
Quote by CoreysMonster
Hey guys, say you have a 2-dimensional vector (x/z), and a vector (1,0). How do you determine the clockwise rotation of the XZ Vector from the other in percent, 0% being 0 degrees and 100% being 360 degrees?

I need to figure this out in the next half hour and can't remember how to do this.

So wait, I think you have the following problem:

Given a vector (x,y) with unit length (i.e. sqrt(x^2+y^2)=1), what is its angle to the vector (1,0).

The way to do this is to take the scalar product of the two vectors. cos(theta)=<a,b>, where theta is the angle between a and b and if a and b are unit vectors.

http://en.wikipedia.org/wiki/Dot_product#Geometric_interpretation
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
I would use the dot product to the get the cosine of the angle between the two vectors. Then use that to get the angle in degrees, then divide that by 3.6.

Are you trying to control a rotating object in Flash?
Quote by Basti95
You put a stick in your bum and you whistle. You whistle LOUD.
DO IT.

I lol'd.
Quote by slapsymcdougal
I'm cockblocked regularly by my appearance and personality.