SuperMap.WindowsPhone.Core.PolygonElementClip.EdgeIntersection C# (CSharp) Method

EdgeIntersection() private static method

private static EdgeIntersection ( Point2D p0, Point2D p1, Edge edge ) : Point2D
p0 Point2D
p1 Point2D
edge Edge
return Point2D
        private static Point2D EdgeIntersection(Point2D p0, Point2D p1, Edge edge)
        {
            Point2D point = new Point2D(p1.X - p0.X, p1.Y - p0.Y);
            if (edge.IsHorisontal)
            {
                return new Point2D(p0.X + ((point.X / point.Y) * (edge.Value - p0.Y)), edge.Value);
            }
            return new Point2D(edge.Value, p0.Y + ((point.Y / point.X) * (edge.Value - p0.X)));
        }