private Edge(Vertex start, Vertex end) : base() { if (start.Equals(end)) { throw new Exception("Edge cannot be created with Vertex with same coordinates"); } StartVertex = start; EndVertex = end; Length = start.DistanceTo(end); Direction = Vector.ByTwoVertices(StartVertex, EndVertex); }
public double DistanceTo(Vertex vertex) { return(vertex.DistanceTo(this)); }