geometry#

Library for (numerical) geometry.

Functions

angle_between(z1, z2, z3)

antipode(circle, point)

arc_from_circle_and_points(circle, point1, ...)

Return the circular arcs lying on circle going from point1 to point2.

arc_from_diamater(point1, point2)

Return the circular arcs lying on circle going from point1 to point2.

bisect(g)

Split object (Segment or CircularArc) into two equal halves.

bisector(s)

Return the bisector line of the segment

bounding_box(g)

circle_through_points(A, B, C)

Return a circle through points A, B, and C.

inverse_point_through_circle(circle, point)

Perform inverse geometry transformation on a given point with respect to a circle.

is_angle_between(theta1, theta2, theta3)

Check if angle theta2 is between angles theta1 and theta3 (modulo 2*pi).

middle(g)

Returns geometric center of a segment or arc

orient_arc(g[, start_point, end_point])

From an unoriented arc/segment, return an oriented one so that the (starting) point 'A' is on average closer to start_point and the (ending) point 'B' is on average closer to end_point.

perpendicular_arc(circle, circle1, circle2)

Return the perpendicular circular arc through the circle that starts and ends at the intersection of circle and circle1 and circle2, respectively.

perpendicular_arc_through_point(circle, ...)

Return the arc that is: - perpendicular to the circle at circle_point - starts at the circle point and goes through the point - (if the point lies on the circle, the arc is perpendicular also at point.

perpendicular_line(l, p)

Return a line that is perpendicular to the other line.

split(g, point)

Split arc/segment g at point (that lies on the arc/segment)

tangent_line(c, p)

Return tangent line assuming point lies on circle, otherwise returns line perpendicular to the radius through the center and p.

translate(element, displacement)

weighted_circle_center_mean(circle1, circle2)

Compute a weighted mean, so that the intersection of cicles are scaled proportinately so they meet.

Classes

BoundingBox([g])

Circle(center, radius)

Representation of a geometric circle in the complex plane.

CircularArc(center, radius, theta1, theta2)

Line(A, B)

OrientedCircularArc(center, radius, theta1, ...)

PolySegment(points)

A polyline segment defined by a list of complex points.

Segment(A, B)