Geometry puzzler

jerry_spicklemire at jerry_spicklemire at
Tue Nov 7 00:20:52 CET 2000

Paul Winkler wrote:

> I have a problem that's more geometry than python per se, but I need a
> solution in python so I thought I'd ask here.
> (snip)
> I need to draw text on a page without it overlapping with various
> other graphic elements on the page. Problem is that those elements
> could be anywhere, so I need a general solution. This would be useful
> for vector-drawing and page layout applications in general.
> (more snip)
> There are two basic but important things I can't figure out how to do:
> 1) Given any polygon, how can I test whether an arbitrary point lies
>    inside that polygon?
> 2) Given two line segments, how can I find the coordinates of their
>    intersection, if there is one? (easy for right angles, but I will
>    often NOT have right angles.)

This sounds like Topology, which is a relative of Geometry, but much
less commonly studied. However, you quite correctly point out that the
algorithms have application in other fields, both 2D and 3D.

One group of software developers that do get pretty deep into Topology
are GIS (Geographic Insformation Systems) programmers. So, you might
try looking at the OpenGIS, and FreeGIS projects:

Jerry S.

Sent via
Before you buy.

More information about the Python-list mailing list