Quellcode durchsuchen

subtraction instead of addition

bmallred vor 12 Jahren
Ursprung
Commit
f1052d7861
2 geänderte Dateien mit 23 neuen und 1 gelöschten Zeilen
  1. 22 0
      EuclideanDistance.userprefs
  2. 1 1
      EuclideanDistance/DoubleExtensions.cs

+ 22 - 0
EuclideanDistance.userprefs

@ -0,0 +1,22 @@
1
<Properties>
2
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
3
  <MonoDevelop.Ide.Workbench ActiveDocument="EuclideanDistance/DoubleExtensions.cs">
4
    <Files>
5
      <File FileName="EuclideanDistance/Main.cs" Line="30" Column="24" />
6
      <File FileName="EuclideanDistance/DoubleExtensions.cs" Line="37" Column="5" />
7
    </Files>
8
    <Pads>
9
      <Pad Id="ProjectPad">
10
        <State expanded="True">
11
          <Node name="EuclideanDistance" expanded="True">
12
            <Node name="DoubleExtensions.cs" selected="True" />
13
          </Node>
14
        </State>
15
      </Pad>
16
    </Pads>
17
  </MonoDevelop.Ide.Workbench>
18
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
19
    <BreakpointStore />
20
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
21
  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
22
</Properties>

+ 1 - 1
EuclideanDistance/DoubleExtensions.cs

@ -33,7 +33,7 @@ namespace EuclideanDistance
33 33
			var vectors = new List<double>();
34 34
			for (int i = 0; i < pointA.Count(); i++)
35 35
			{
36
				vectors.Add(Math.Pow((pointA.ElementAt(i) + pointB.ElementAt(i)), 2));
36
				vectors.Add(Math.Pow((pointA.ElementAt(i) - pointB.ElementAt(i)), 2));
37 37
			}
38 38
39 39
			// Return the sqare root of the sum of vectors.