#1

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.

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

#2

Use the rotation matrix with the correct angle I believe.

#3

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

DO IT.

Sorry i don't know how to do this stuff yet

#4

Use the rotation matrix with the correct angle I believe.

What?

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

#5

What?

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

#6

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.

#7

It just sounded like unit conversion to me.

#8

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.

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

*Last edited by CoreysMonster at Nov 29, 2011,*

#9

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

#10

Wait a few months while I go back to school and then have an answer to that question.

#11

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

#12

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?

Are you trying to control a rotating object in Flash?

#13

You put a stick in your bum and you whistle. You whistle LOUD.

DO IT.

I lol'd.

#14

Oh shit! my professor taught this to me today!...

But only with one vector?

But only with one vector?