示例#1
0
        private static System.Nullable <PointD> GetBothVerticalIntersection(LineD line, LineD other)
        {
            System.Nullable <PointD> ret = null;

            if (line.X.X == other.X.X)
            {
                if (line.X.Y.IsBetween(other.X.Y, other.Y.Y))
                {
                    ret = line.X;
                }
                else if (line.Y.Y.IsBetween(other.X.Y, other.Y.Y))
                {
                    ret = line.Y;
                }
                else
                {
                    ret = null;
                }
            }
            else
            {
                ret = null;
            }

            return(ret);
        }
示例#2
0
        private static System.Nullable <PointD> GetVerticalIntersection(LineD vertical, LineD other)
        {
            System.Nullable <PointD> ret = default(System.Nullable <PointD>);

            double y = other.A * vertical.X.X + other.B;

            ret = new PointD(vertical.X.X, y);

            if (!vertical.IsOnLine(ret.Value))
            {
                ret = null;
            }
            else if (!other.IsOnLine(ret.Value))
            {
                ret = null;
            }

            return(ret);
        }
示例#3
0
        private static System.Nullable <PointD> GetHorizontalIntersection(LineD horizontal, LineD other)
        {
            System.Nullable <PointD> ret = null;

            ret = GetSkewIntersection(horizontal, other);

            return(ret);
        }