somewhat better most of the time but still not giving optimal results when the chosen origin is close to a given line segment