示例#1
0
        public Edge PseudoPerpendicularOn(Edge edge)
        {
            if (edge.Length < 4.94065645841247E-324)
            {
                return(edge.StartPoint.PerpendicularOn(this));
            }
            Line line = edge.ToLine();

            if (this.IsParallelTo(line))
            {
                throw new ArgumentException("Can not compute perpendicular: line and edge are parallel.");
            }
            Edge edge2 = this.PerpendicularOn(line);

            if (edge.CollinearContains(edge2.EndPoint))
            {
                return(edge2);
            }
            Edge edge3 = edge.StartPoint.PerpendicularOn(this);
            Edge edge4 = edge.EndPoint.PerpendicularOn(this);

            if (edge4.Length >= edge3.Length)
            {
                return(edge3);
            }
            return(edge4);
        }
示例#2
0
        public Point method_4(Edge edge)
        {
            Point point = this.method_3(edge.ToLine());

            if (point == null)
            {
                return(null);
            }
            if (edge.CollinearContains(point))
            {
                return(point);
            }
            return(null);
        }
示例#3
0
        public Point getInterSection(Edge edge)
        {
            Point point = edge.ToLine().getInterSecttion(this);

            if (point == null)
            {
                return(null);
            }
            if (this.IsCoplanarTo(edge))
            {
                return(null);
            }
            if (edge.CollinearContains(point))
            {
                return(point);
            }
            return(null);
        }
示例#4
0
        public Edge PseudoPerdendicularOn(Edge edge)
        {
            if (edge.Length < 4.94065645841247E-324)
            {
                return(new Edge(this, edge.MidPoint));
            }
            Point point = this.method_0(edge.ToLine());

            if (edge.CollinearContains(point))
            {
                return(new Edge(this, point));
            }
            double num  = this.DistanceTo(edge.StartPoint);
            double num2 = this.DistanceTo(edge.EndPoint);

            if (num < num2)
            {
                return(new Edge(this, edge.StartPoint));
            }
            return(new Edge(this, edge.EndPoint));
        }
示例#5
0
 public bool IsCollinearTo(Edge edge)
 {
     return(edge.Length < 4.94065645841247E-324 || edge.ToLine().Contains(this));
 }
示例#6
0
 public bool IsParallelTo(Edge edge)
 {
     return(this.vector3d_0.IsParallelTo(edge.ToLine().DirectionVector));
 }