I am programming a molecular dynamics program with periodic boundary conditions. Here, I have a problem:
I have a list of coordinates like
list = RandomReal[{0, 1}, {5, 2}]
And now, I want to have the distances.
I do that with
EuclideanDistance @@@ Subsets[list, {2}]
But now, I do not know the direction, so if the distance not squared was positive or negative. Does someone know, how I can obtain the sign? Because I need that for computing my periodic boundary conditions
EuclideanDistance
is always positive. Please clarify "direction"! $\endgroup$x1-x2<0
andy1-y2>0
? $\endgroup$