Free cookie consent management tool by TermsFeed Policy Generator

source: branches/FitnessLandscapeAnalysis/VRPProblemAnalyzer/PointD.cs @ 12722

Last change on this file since 12722 was 7315, checked in by epitzer, 13 years ago

#1696: Add VRP depot excentricity metrics

File size: 515 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace VRPProblemAnalyzer {
7
8  public class PointD : Tuple<double, double> {
9    public double X { get { return Item1; } }
10    public double Y { get { return Item2; }}
11    public PointD(double x, double y) : base(x, y) {}
12    public double DistanceTo(PointD other) {
13      return Math.Sqrt(Square(X - other.X) + Square(Y - other.Y));
14    }
15    private static double Square(double x) { return x*x; }
16  }
17}
Note: See TracBrowser for help on using the repository browser.