p = ( (by-dy)*(cx-dx) - (bx-dx)*(cy-dy) ) / ( (ax-bx)*(cy-dy) - (ay-by)*(cx-dx) ) px= p*ax + (1-p)*bx py= p*ay + (1-p)*by