Geometry: facilities functions for geometry calculations

Geometry: facilities functions for geometry calculations

pymt.geometry.circumcircle(a, b, c)

Computes the circumcircle of a triangel defined by a,b,c see: http://en.wikipedia.org/wiki/Circumscribed_circle#Circumscribed_circles_of_triangles

Parameters :
a : iterable

the 1. point of the triangle

b : iterable

the 2. point of the triangle

c : iterable

the 3. point of the triangle

Return :
A Circle that defined the tuple :
  • The first element in the returned touple is the center (tuple x,y)
  • The second the radius (float)
pymt.geometry.minimum_bounding_circle(points)

Returns the minimum bounding circle for a set of points

For a description of the problem being solved see http://en.wikipedia.org/wiki/Smallest_circle_problem The function uses Applet’s Algorithm Algorithm, worst case teh runtime is O(h^3 *n), where h= number of points in teh convex hull of the set of points. But it runs in linear time in almost all real world cases. see: http://www.personal.kent.edu/~rmuhamma/Compgeometry/MyCG/CG-Applets/Center/centercli.htm

Parameters :
points : iterable

A list of points (2 tuple with x,y coordinates)

Return :
A Circle that defined the tuple :
  • The first element in the returned touple is the center (tuple x,y)
  • The second the radius (float)

Previous topic

Exception Manager: add/remove handler for exception in application

Next topic

Gesture: Base for gesture recognition.

This Page