Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

In search of an algorithm

56 views
Skip to first unread message

Helmut Giese

unread,
Aug 30, 2019, 12:14:57 PM8/30/19
to
Hello out there,
a polyline (in tkpath speak) is a line consisting of several
'segments'.
Q: Find out on which segment a given point lies.

My own homebrewn solution appears to have a mysterious bug, which I
haven't been able to find so far, so I thought I'd ask for a fresh
approach.

Thanks for any ideas
Helmut

fr

unread,
Aug 30, 2019, 1:25:26 PM8/30/19
to
maybe https://programmizm.sourceforge.io/blog/2012/distance-from-a-point-to-a-polyline will help?
However I suspect tkpath polylines are rather splines - with open ends.

Helmut Giese

unread,
Aug 30, 2019, 2:53:21 PM8/30/19
to
Thanks for this idea. In the meantime I found
calculateDistanceToLineSegment
in TclLib's math::geometry package. So I will loop over all segments
and if the distance is smaller than some epsilon I will consider the
point on the line.
But thanks for caring.
Helmut
0 new messages