circle

This class contains methods useful for working with circles.

This will be used to build a LazyDelaunayTriangulation class which will compute the Delaunay decomposition for infinite surfaces.

class flatsurf.geometry.circle.Circle(center, radius_squared, base_ring=None)[source]

Construct a circle from a Vector representing the center, and the radius squared.

center()[source]

Return the center of the circle as a vector.

closest_point_on_line(point, direction_vector)[source]

Consider the line through the provided point in the given direction. Return the closest point on this line to the center of the circle.

line_position(point, direction_vector)[source]

Consider the line through the provided point in the given direction. We return 1 if the line passes through the circle, 0 if it is tangent to the circle and -1 if the line does not intersect the circle.

line_segment_position(p, q)[source]

Consider the open line segment pq.We return 1 if the line segment enters the interior of the circle, zero if it touches the circle tangentially (at a point in the interior of the segment) and and -1 if it does not touch the circle or its interior.

other_intersection(p, v)[source]

Consider a point p on the circle and a vector v. Let L be the line through p in direction v. Then L intersects the circle at another point q. This method returns q.

Note that if p and v are both in the field of the circle, then so is q.

EXAMPLES:

sage: from flatsurf.geometry.circle import Circle
sage: c=Circle(vector((0,0)), 25, base_ring=QQ)
sage: c.other_intersection(vector((3,4)),vector((1,2)))
(-7/5, -24/5)
point_position(point)[source]

Return 1 if point lies in the circle, 0 if the point lies on the circle, and -1 if the point lies outide the circle.

radius_squared()[source]

Return the square of the radius of the circle.

tangent_vector(point)[source]

Return a vector based at the provided point (which must lie on the circle) which is tangent to the circle and points in the counter-clockwise direction.

EXAMPLES:

sage: from flatsurf.geometry.circle import Circle
sage: c=Circle(vector((0,0)), 2, base_ring=QQ)
sage: c.tangent_vector(vector((1,1)))
(-1, 1)
flatsurf.geometry.circle.circle_from_three_points(p, q, r, base_ring=None)[source]

Construct a circle from three points on the circle.