# Value of 'a' component of Vector

Discussion in 'Homework Help' started by zulfi100, Apr 6, 2015.

1. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Suppose I have two points : P1 (1,1,1) and P2(6,6,6), What would be the value of a?

a= dx/|V| = (6-1)/ sqrt(25 + 25+25)

Is the above correct?

I have found that one site used following method:

Zulfi.

2. ### shteii01 AAC Fanatic!

Feb 19, 2010
3,500
511
The vector has three components. Which component is a?

3. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
There is a 1 of 3 chance that it is the x component, but does it really matter given the points chosen.

4. ### shteii01 AAC Fanatic!

Feb 19, 2010
3,500
511
Yeah, I see what you mean, it is a cube, all components same length.

I guess, in this context, value of A is sqrt(Ax^2+Ay^2+Az^2)

5. ### panic mode Senior Member

Oct 10, 2011
1,328
305
you have not asked question properly so it is a mystery what you have in mind

you have two points
P1(x1,y1,z1) = (1,1,1)
P2(x2,y2,z2)=(6,6,6)

dx = a = x2-x1
dy = b = y2-y1
dz = c = z2-z1

or V(a,b,c) = (x2-x1, y2-y1,z2-z1) = (5,5,5)

if you want to compute unit vector V' that has same direction as V, you need to divide each of elements by vector length and you get
d=sqrt(a^2+b^2+c^2) = 5*sqrt(3)

so
V' = V/|V| = (a/d, b/d, c/d) = (sqrt(3)/3, sqrt(3)/3, sqrt(3)/3)

but I am only guessing this is what you had in mind...

6. ### panic mode Senior Member

Oct 10, 2011
1,328
305
wait a second - you are the guy that was about to write 3D animation using shaders, homogeneous transforms etc....?
and you have problem with this...? hmmm, I foresee that your 3D programming project will be put on a very very long hold...

7. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Thanks everybody for replying to my post. I have the problem with the following stuff:

I have the following question from a web site related to 3d rotation about an arbitrary axis. It has been done in the same way as Mr. panic mode answered:

But in the book, i found different formula for evaluating the value of a:

Somebody please guide me, which formula should i use for calculating the value of 'a', 'b' and 'c' provided the question in image "example 3d rotation about an arbitrary axis.png".

Zulfi.

8. ### panic mode Senior Member

Oct 10, 2011
1,328
305
orientation about arbitrary axis is fun thing....
you need to compute unit vector that lies on that axis.
then you need to compute angles you need to rotate to get to that unit vector orientation.
then you need to know order of transforms (Euler)
then you need to do bunch of matrix multiplications, something like

if this is homework, you really need to go back to classes and read your material. this is beyond hopeless if you ask me.

9. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
That's what you are doing. Plz dont reply me if you dont know the answer.
yes, you really need this because you asked me in my earlier post to keep the book aside.

Zulfi.

10. ### panic mode Senior Member

Oct 10, 2011
1,328
305
I am sorry if this is not what you expected. If this is homework, you have a lot catching up to do. I cannot write answers for you, you need to do this yourself, I can only try to help. And I did provide steps and code too (computing of inverse transform from three points in space, etc). Don't worry, I will stay out of this from now on...

11. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
I feel sorry if i hurt you but i have asked you only a technical Question about the difference between the two formulas and the one which is valid. I am not asking you to provide me the solution. Even then if you think that its a homework Question, You can avoid answering it. This is how other people are doing. I would advise you to remain part of this forum. Thanks for your positive comments.

Zulfi.