Value of 'a' component of Vector

Thread Starter

zulfi100

Joined Jun 7, 2012
656
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:upload_2015-4-6_23-29-59.png value of a.png
Some body please guide me.

Zulfi.
 

panic mode

Joined Oct 10, 2011
2,753
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)

according to your images:
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...
 

panic mode

Joined Oct 10, 2011
2,753
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... ;)
 

Thread Starter

zulfi100

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

according to your images:
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)
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:

example 3d rotation about an arbitrary axis.png
But in the book, i found different formula for evaluating the value of a:

formula of vector with its components.png

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.
 

panic mode

Joined Oct 10, 2011
2,753
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
Rx(-c)Ry(-b)Rz(your angle)Ry(b)Rx(c)

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

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
orientation about arbitrary axis is fun thing....
That's what you are doing. Plz dont reply me if you dont know the answer.
you really need to go back to classes and read your material
yes, you really need this because you asked me in my earlier post to keep the book aside.

Zulfi.
 

panic mode

Joined Oct 10, 2011
2,753
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...
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
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.
 
Top