If the given point is contained by the polygon, return it. Otherwise
return the closest point on the polygon boundary. If the polygon is
empty, return the input argument. Note that the result may or may not be
contained by the polygon. "x" should be unit length.
If the given point is contained by the polygon, return it. Otherwise return the closest point on the polygon boundary. If the polygon is empty, return the input argument. Note that the result may or may not be contained by the polygon. "x" should be unit length.