Navigation

The geometry module for SymPy allows one to create two-dimensional geometrical
entities, such as lines and circles, and query information about these
entities. This could include asking the area of an ellipse, checking for
collinearity of a set of points, or finding the intersection between two lines.
The primary use case of the module involves entities with numerical values, but
it is possible to also use symbolic representations.

The area property of Polygon and Triangle may return a positive or
negative value, depending on whether or not the points are oriented
counter-clockwise or clockwise, respectively. If you always want a
positive value be sure to use the abs function.

Although Polygon can refer to any type of polygon, the code has been
written for simple polygons. Hence, expect potential problems if dealing
with complex polygons (overlapping sides).

Since !SymPy is still in its infancy some things may not simplify
properly and hence some things that should return True (e.g.,
Point.is_collinear) may not actually do so. Similarly, attempting to find
the intersection of entities that do intersect may result in an empty
result.

Even though the result is currently , this is not _always_ true. If the
quantity then the points will be collinear. It
would be really nice to inform the user of this because such a quantity may be
useful to a user for further calculation and, at the very least, being nice to
know. This could be potentially done by returning an object (e.g.,
GeometryResult) that the user could use. This actually would not involve an
extensive amount of work.

Currently there are no plans for extending the module to three dimensions, but
it certainly would be a good addition. This would probably involve a fair
amount of work since many of the algorithms used are specific to two
dimensions.