To determine if $P$ is convex we first traverse the vertices of $P$ in a counterclockwise order, making sure each one determines a left turn. This is not enough, however, for $P$ could self-intersect. So, we next pick a vertex $v$ on $P$ and determine, for each other vertex $w$ that the line $vw$ is locally interior to $P$ with respect to the edges incident on $v$ and $w$ respectively.