inside outside p1 p2 p3