messin18
January 2nd, 2007, 06:08 PM
I have two 3d points in space.
Vector 1, Vector 2
Looking overhead and assumeing vector 1 is the center and vector 2 is some point rotated around vector 1 i need to find that angle from 0 to 360 degrees. Useing the length from vector 1 to vector 2 as the radius of the circle. Basically it boils down to 2d math because i eliminate y and just use x and z from my vector.
I can't figure out how to do this..
I tried useing: angle = opposite / adjacent * tan -1
And i was calculateing it like:
opposite = vector2.z - vector1.z
adjacent = vector2.x = vector1.x
This wont' give me the angle from 0 to 360 around a circle... so how do i do it? I'm assumeing it'll have something to do with a forumla useing Arc Length of a Circle... but i can't quite figure it out.
Vector 1, Vector 2
Looking overhead and assumeing vector 1 is the center and vector 2 is some point rotated around vector 1 i need to find that angle from 0 to 360 degrees. Useing the length from vector 1 to vector 2 as the radius of the circle. Basically it boils down to 2d math because i eliminate y and just use x and z from my vector.
I can't figure out how to do this..
I tried useing: angle = opposite / adjacent * tan -1
And i was calculateing it like:
opposite = vector2.z - vector1.z
adjacent = vector2.x = vector1.x
This wont' give me the angle from 0 to 360 around a circle... so how do i do it? I'm assumeing it'll have something to do with a forumla useing Arc Length of a Circle... but i can't quite figure it out.