15,741,692 members
See more:
Hi friends........

we can find disance for two 3D vectors from this formula.
C#
```Vector3f u = new Vector3f(X,Y,Z);
Vector3f v = new Vector3f(X,Y,Z);

decimal  a = (u.X - v.X)
decimal  b = (u.Y - v.Y)
decimal  c = (u.Z - v.Z)

decimal distance= Math.Squareroot(a * a + b * b + c * c);```

i have one 3D vector and distance.
i need the other 3D vector....
Please reply me the derived formula to calculate the other 3D vector.
Thank You Friends..........
Posted
Updated 3-Jun-13 4:41am
v3
E.F. Nijboer 3-Jun-13 10:43am
You cannot derive a single vector from just a vector and distance.
Sergey Alexandrovich Kryukov 3-Jun-13 11:05am
Right, the question makes no sense at all. The shown formula is correct, but the question demonstrates the lack of understanding what a vector is.

This is elementary (well, almost) mathematics, some field of mathematics which is prerequisite to programming of such problems. But this is the software forum. So, the question is, formally, off-topic. The inquirer needs to master the prerequisite topics first, then ask questions...

—SA

## Solution 1

The coordinates of the 'other vector' are

C++
```x(theta, phi) = X0 + D * sin(theta) * cos(phi)
y(theta, phi) = Y0 + D * sin(theta) * sin(phi)
z(theta, phi) = Z0 + D * cos(theta)```

where `D` is the dinstance, `theta` and `phi` have arbitrary values.
That means you have not a single vector at distance `D` but infinite (squared!) ones. If you like you may assign values to `theta` and `phi` to pick one of them.

## Solution 2

yea, sorry for my misunderstand in vectors..
I found the answer by deriving a single vector, distance and magnitude of the second vector to find Second Vector........