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