Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 |
|
---|
6 | namespace 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.