public TriangleVertex OppositeVertex(TriangleLine TriLine) { var startCoor = TriLine.StartLine.LineCoor; var endCoor = TriLine.EndLine.LineCoor; var loc = LineCoordinates.CommonEndPoint(startCoor, endCoor); var angle = LineCoordinates.AngleBetween(startCoor, endCoor); var oppVertex = new TriangleVertex() { Angle = angle, Line = TriLine.LineCoor, Location = loc }; return(oppVertex); }
public static XElement ToXElement(this TriangleVertex Vertex, XName Name) { if (Vertex == null) { return(new XElement(Name, null)); } else { XElement xe = new XElement(Name, new XElement("Angle", Vertex.Angle), Vertex.Location.ToXElement("Location"), Vertex.Line.ToXElement("Line") ); return(xe); } }
public static TriangleVertex ToTriangleVertex( this XElement Elem, XNamespace Namespace) { TriangleVertex vertex = null; if (Elem != null) { var angle = Elem.Element(Namespace + "Angle").DoubleOrDefault(0).Value; var location = Elem.Element(Namespace + "Location").ToPoint(Namespace); var line = Elem.Element(Namespace + "Line").ToLineCoordinates(Namespace); vertex = new TriangleVertex( ) { Angle = angle, Location = location, Line = line }; } return(vertex); }