Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public double DistanceTo(Vertex vertex)
 {
     return(vertex.DistanceTo(this));
 }