public float DistanceTo( IntPoint anotherPoint ) { int dx = X - anotherPoint.X; int dy = Y - anotherPoint.Y; return (float) System.Math.Sqrt( dx * dx + dy * dy ); }
public void Add(IntPoint point) { if (Points.Count != 0) { Length += point.DistanceTo(Points.Last()); } Points.Add(point); }