private double GetLength(Tape tape, Cluster cluster, ref bool start) { double distance1 = Math.Sqrt(Math.Pow(tape.StartPoint.X - cluster.X, 2) + Math.Pow(tape.StartPoint.Y - cluster.Y, 2)); double distance2 = Math.Sqrt(Math.Pow(tape.EndPoint.X - cluster.X, 2) + Math.Pow(tape.EndPoint.Y - cluster.Y, 2)); distance1 = Math.Min(distance1, distance2); start = Math.Min(distance1, distance2) == distance1; return distance1; }
public Tape(Tape old) { start = new Point(old.StartPoint.X, old.StartPoint.Y); end = new Point(old.EndPoint.X, old.EndPoint.Y); reversed = old.reversed; }