I've been reading T.M. Chan algorithm for convex hull of a 2D polygon, here he says that we can find a support line (tangent line) to a polygon given that this polygon is convex and we have its vertices on CCW order in $O(\log H)$ time with $H$ being the number of vertices on the convex hull of the polygon.
Now, I could take this for granted but I decided to see exactly how, since we had it in class but with time $O(n)$. By looking at the references (Shamos and Preparata book) and a Chazelle article I find myself more confused than happy.
Looked into some other notes about convex hull where Chan's algorithm is simplified into text (which is great because now I can understand the time bound better) but here the part about $O(\log H)$ for tangent lines is took by granted and actually left as an exercise so I decided to try it.
To find lets say just a right tangent line to a polygon $P$ given its vertices $p_0,p_1,\dots,p_n$ in CCW order and a point $q$ that lies outside the boundary of $P$, I think first I need to locate the maximum and minium $y-$oriented points, I can do this in $O(\log n)$ ($n$ points on $CH(P)$), but then I'm stuck in the part where I need to do binary search over the other points of $CH(P)$ to find the tangent line.
Any hints?
Right tangent line from a query point $q$ located outside $P$: find a vertex $p_i$ such that $P$ is contained in the closed half-plane to the left of the oriented line $qp_i$.
Best Answer
To be read in order, and ideally not all at once.
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5