Changeset 884 for trunk/sources/HeuristicLab.Routing.TSP/TSPRoundedEuclideanDistanceMatrixInjector.cs
- Timestamp:
- 12/02/08 12:41:21 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Routing.TSP/TSPRoundedEuclideanDistanceMatrixInjector.cs
r2 r884 28 28 29 29 namespace HeuristicLab.Routing.TSP { 30 /// <summary> 31 /// Injects a distance matrix with euclidean distances of a TSP path into the current scope. 32 /// </summary> 30 33 public class TSPRoundedEuclideanDistanceMatrixInjector : TSPDistanceMatrixInjectorBase { 34 /// <inheritdoc/> 31 35 public override string Description { 32 36 get { return @"TODO\r\nOperator description still missing ..."; } 33 37 } 34 38 39 /// <summary> 40 /// Calculates the distance between two points by using the euclidean distance. 41 /// </summary> 42 /// <param name="x1">The x coordinate of point 1.</param> 43 /// <param name="y1">The y coordinate of point 1.</param> 44 /// <param name="x2">The x coordinate of point 2.</param> 45 /// <param name="y2">The y coordinate of point 2.</param> 46 /// <returns>The euclidean distance between the two points.</returns> 35 47 protected override double CalculateDistance(double x1, double y1, double x2, double y2) { 36 48 return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
Note: See TracChangeset
for help on using the changeset viewer.