Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        private static System.Nullable <PointD> GetSkewIntersection(LineD line, LineD other)
        {
            System.Nullable <PointD> ret = default(System.Nullable <PointD>);

            double x = ((other.B - line.B) / (line.A - other.A));
            double y = other.A * x + other.B;

            ret = new PointD(x, y);

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

            return(ret);
        }