Skip to content
Alessandro Febretti edited this page Aug 28, 2013 · 2 revisions

[[module omega | Python-Reference#module-omega]]

Circles are constructed with a center Point2 and a radius:

    >>> c = Circle(Point2(1.0, 1.0), 0.5)
    >>> c
    Circle(<1.00, 1.00>, radius=0.50)

Internally there are two attributes: c, giving the center point and r, giving the radius.

The following methods are supported:

intersect(other)

If other is a Line2, Ray2 or LineSegment2, returns a LineSegment2 giving the part of the line that intersects the circle, or None if there is no intersection.

connect(other)

Returns a LineSegment2 which is the minimum length line segment that can connect the two shapes. other may be a Point2, Line2, Ray2, LineSegment2 or Circle.

distance(other)

Returns the absolute minimum distance to other. Internally this simply returns the length of the result of connect.

Clone this wiki locally