|
|
BorisW37 wrote:
> BorisW37 wrote:
>
>>If i have 2 points A <x1,y1,z1> and B <x2,y2,z2>, how do i find coordinates
>>of point C <x3,y3,z3> which lies on the line AB, distance D from point A?
>>
>>Thank you,
>>
>>Boris.
>>
>
>
> I got it:
> First find D=distance between A and B
> D=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2)
> then
> x3=x1+d/D(x2-x1)
> y3=y1+d/D(y2-y1)
> z3=z1+d/D(z2-z1)
>
> but now i have another question, if I have a vector named my_vector
> # declare my_vector=<1,2,3>;
>
> how do i find individual values of x,y and z
> so that i could find
> #declare my_vector_X=.....; (shoud be 1)
> #declare my_vector_Y=.....; (shoud be 2)
> #declare my_vector_Z=.....; (shoud be 3)
>
When you have vector V, you access its coordinates with V.x, V.y and
V.z, but it's usually better to use vectors in your formulas.
JC
Post a reply to this message
|
|