private bool FindIntersectingPoints(double x11, double y11, double x12, double y12, double x21, double y21, double x22, double y22)
        {
            double pixelHeight;

            pixelHeight = bitmap.PixelHeight;
            if (y11 <= -pixelHeight)
            {
                y11 = -2 * pixelHeight;
            }
            if (y12 <= -pixelHeight)
            {
                y12 = -2 * pixelHeight;
            }
            if (y21 <= -pixelHeight)
            {
                y21 = -2 * pixelHeight;
            }
            if (y22 <= -pixelHeight)
            {
                y22 = -2 * pixelHeight;
            }

            if (y11 >= 2 * pixelHeight)
            {
                y11 = 4 * pixelHeight;
            }
            if (y12 >= 2 * pixelHeight)
            {
                y12 = 4 * pixelHeight;
            }
            if (y21 >= 2 * pixelHeight)
            {
                y21 = 4 * pixelHeight;
            }
            if (y22 >= 2 * pixelHeight)
            {
                y22 = 4 * pixelHeight;
            }

            intersectingPoint = new Point();

            // First  line  slope and intersect( y = mx+c )
            double m = WriteableBitmapExtensions.Slope(x11, y11, x12, y12);
            double c = double.NaN;

            if (!double.IsInfinity(m))
            {
                c = WriteableBitmapExtensions.Intersect(x12, y12, m);
            }

            // Second line slope and intersect
            double m1 = WriteableBitmapExtensions.Slope(x21, y21, x22, y22);
            double c1 = double.NaN;

            if (!double.IsInfinity(m1))
            {
                c1 = WriteableBitmapExtensions.Intersect(x21, y21, m1);
            }

            // point intersecting for both straight line.(Cross point for lines)
            double x = (c1 - c) / (m - m1);

            intersectingPoint.X = (int)x;
            intersectingPoint.Y = (int)(m * x) + c;

            return((double.IsNaN(x) || double.IsNaN(intersectingPoint.Y)) ? false : true);
        }