• Support PF! Buy your school textbooks, materials and every day products Here!

Direction Vector

  • #1

Homework Statement



I have two x,y,z coordinates - a & b. I know the distance between the coordinates. I need to get a 3D vector which represent the direction between vector a and vector b.

Homework Equations



I am unsure as to whether the I should simply substract each respective coordinate value from one to the other i.e. (x1-x2,y1-y2,z1-z2)

The Attempt at a Solution



I tried to apply the forumula above to a trivial case e.g.

A = (1,1,1); B = (2,2,2); C=(2-1,2-1,2-1,)=(1,1,1)

I am not sure if this is right.
 

Answers and Replies

  • #2
dx
Homework Helper
Gold Member
2,011
18
That's right.
 
  • #3
Thanks.
 
  • #4
On a side note - how can i calculate the second vector from the first vector and the direction vector? Would l just add the direction vect to the first vector?
 
  • #5
dx
Homework Helper
Gold Member
2,011
18
obviously, if d = b - a, then b = a + d!:smile:
 
  • #6
Thanks again!
 

Related Threads for: Direction Vector

  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
1
Views
796
  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
4
Views
682
Replies
1
Views
18K
  • Last Post
Replies
8
Views
17K
  • Last Post
Replies
6
Views
1K
Top