Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Euclidean distance of all pairwise combinations (redundants)
Replies: 7   Last Post: Feb 1, 2013 1:16 AM

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: Euclidean distance of all pairwise combinations (redundants)
Posted: Nov 15, 2012 4:07 AM

On 11/14/2012 12:33 AM, Jesse Pisel wrote:
>
> list = {{1, 1}, {2, 2}, {3, 3}}
> EuclideanDistance @@@ Subsets[list, {2}]
>
> Any ideas on how to get the euclidean distance between all the points
>including redundants and self references?
>
>

may be

------------------
list = {{1, 1}, {2, 2}, {3, 3}}
EuclideanDistance @@@ Tuples[list, 2]
-----------------

{0,Sqrt[2],2 Sqrt[2],Sqrt[2],0,Sqrt[2],2 Sqrt[2],Sqrt[2],0}

--Nasser

Date Subject Author
11/14/12 Jesse Pisel
11/15/12 Nasser Abbasi
11/18/12 Ray Koopman
2/1/13 Francisco Gutierrez
2/1/13 Ray Koopman
2/1/13 Bob Hanlon