Last change
on this file since 8189 was 8189, checked in by kjdon, 20 years ago |
first version of Imperial College's Visualiser code
|
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
347 bytes
|
Line | |
---|
1 | package vishnu.cluster;
|
---|
2 |
|
---|
3 | public class EuclideanDistance extends Distance
|
---|
4 | {
|
---|
5 | public double get(double[] v1, double[] v2, int size)
|
---|
6 | {
|
---|
7 | double sum = 0, x;
|
---|
8 | //System.out.println("Array length "+ v1.length);
|
---|
9 | for(int c=0;c<v1.length;c++)
|
---|
10 | {
|
---|
11 | x = v1[c] - v2[c];
|
---|
12 | sum += x*x;
|
---|
13 | }
|
---|
14 | return Math.sqrt(sum);
|
---|
15 | }
|
---|
16 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.