goulib.geom

2D geometry

Functions

Polar(mag, angle)

_center_of_circle_from_3_points(a, b, c)

constructs circle passing through 3 distinct points :param a,b,c: Point2 :return: x,y coordinates of center of circle

_connect_circle_circle(A, B)

_connect_circle_line2(C, L)

_connect_line2_line2(A, B)

_connect_point2_circle(P, C)

_connect_point2_line2(P, L)

_hash(v)

hash function for vectors

_intersect_circle_circle(c1, c2)

Circle/Circle intersection :param c1: Line2 (or derived class) :param c2: Circle (or derived class) :return: None, single Point2, [Point2,Point2] or smallest Circle if inscribed

_intersect_line2_circle(L, C)

Line2/Circle intersection :param L: Line2 (or derived class) :param C: Circle (or derived class) :return: None, single Point2 or [Point2,Point2]

_intersect_line2_line2(A, B)

arc_from_3_points(a, b, c)

constructs Arc2 starting in a, going through b and ending in c :param a,b,c: Point2 :return: the unique Arc2 starting in a, going through b and ending in c

argPair(x[, y])

Process a pair of values passed in various ways.

circle_from_3_points(a, b, c)

constructs Circle passing through 3 distinct points :param a,b,c: Point2 :return: the unique Circle through the three points a, b, c

Classes

Arc2(center[, p1, p2, r, dir])

Circle(*args)

Circles are constructed with a center Point2 and a radius.

Ellipse(*args)

Geometry(*args)

The following classes are available for dealing with simple 2D geometry.

Line2(*args)

A Line2 is a line on a 2D plane extending to infinity in both directions; a Ray2 has a finite end-point and extends to infinity in a single direction; a Segment2 joins two points.

Matrix3(*args)

Two matrix classes are supplied, Matrix3, a 3x3 matrix for working with 2D affine transformations, and Matrix4, a 4x4 matrix for working with 3D affine transformations.

Point2(*args)

A point on a 2D plane. Construct in the obvious way::.

Polygon(args)

Ray2(*args)

this constructor is called by descendant classes at copy it is replaced to copy some graphics attributes in module drawings

Segment2(*args)

this constructor is called by descendant classes at copy it is replaced to copy some graphics attributes in module drawings

Surface(*args)

this constructor is called by descendant classes at copy it is replaced to copy some graphics attributes in module drawings

Vector2(*args)

Mutable 2D vector: