Search All of the Math Forum:

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

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

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Ray Koopman Posts: 3,383 Registered: 12/7/04
Re: Euclidean distance of all pairwise combinations (redundants)
Posted: Feb 1, 2013 1:16 AM
 Plain Text Reply

On Jan 31, 5:46 pm, vasiliadesmixa...@gmail.com wrote:
> Hi,
>
> I am wondering on how to get the euclidean distance between all the point from two different list .
>
> For example : list1=[{1,1,1},{1,3,1},{3,2,4}] , list2=[{1,2,1},{1,2,3}] etc.
>
> how to find the euclidean comparing all the pairs ?? {1,1,1} with {1,2,1} and then {1,1,1} with {1,2,3} etc...

Partition[Norm/@Plus@@Transpose@Tuples@{list1,-list2},Length@list2]

{{1, Sqrt[5]}, {1, Sqrt[5]}, {Sqrt[13], Sqrt[5]}}

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

© The Math Forum at NCTM 1994-2016. All Rights Reserved.