# Thread: Angle between two points

1. ## Angle between two points

Hi there.
Can you help me?

I got two points(X,Y,Z) A and B in space.

How can I find the look vector from A to B grom a given moment?

I mean, at zero frame, "A" got no rotation at all.
And at frame 10, for example, "B" move 10 units on -X. How can I calculate the angle I have to rotate in "A" to continue viewing the "B" coordinate ?

2. ## Re: Angle between two points

Dear Guilhereme,

1. lookAtVector = pointB - pointA
2. I am not sure But try this
a. value = ((pointB.x - 10)/lookAtVector.z)
b. angle = arctan(value);

Rajesh.R
IRIS,CAIR,
Bangalore - 1

3. ## Re: Angle between two points

search for 'The Matrix and Quaternions FAQ'
Q39. How do I generate a rotation matrix to map one vector onto another?

although How can I find the look vector from A to B grom a given moment?
is simple A-B perhaps normalize the result

4. ## Re: Angle between two points

The vector from A to B is B-A. It's always target minus source

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•