Navigation: Up, Table of Contents, Bibliography, Index, Title Page

2D Circle (CGAL_Circle_2)

Definition

An object of type CGAL_Circle_2<R> is a circle in the two-dimensional Euclidean plane E2. The circle is oriented, i.e. its boundary has clockwise or counterclockwise orientation. The boundary splits E2 into a positive and a negative side, where the positive side is to the left of the boundary. The boundary further splits E2 into a bounded and an unbounded side. Note that the circle can be degenerated, i.e. the squared radius may be zero.

#include <CGAL/Circle_2.h>

Creation

CGAL_Circle_2<R> circle ( CGAL_Point_2<R> center,
R::FT squared_radius,
CGAL_Orientation orientation = CGAL_COUNTERCLOCKWISE);
introduces a variable circle of type CGAL_Circle_2<R>. It is initialized to the circle with center center, squared radius squared_radius and orientation orientation.
Precondition: orientation CGAL_COLLINEAR, and further, squared_radius >= 0.

CGAL_Circle_2<R> circle ( CGAL_Point_2<R> p,
CGAL_Point_2<R> q,
CGAL_Point_2<R> r);
introduces a variable circle of type CGAL_Circle_2<R>. It is initialized to the unique circle which passes through the points p, q and r. The orientation of the circle is the orientation of the point triple p, q, r.
Precondition: p, q, and r are not collinear.

CGAL_Circle_2<R> circle ( CGAL_Point_2<R> p,
CGAL_Point_2<R> q,
CGAL_Orientation orientation = CGAL_COUNTERCLOCKWISE);
introduces a variable circle of type CGAL_Circle_2<R>. It is initialized to the circle with diameter \overlinepq and orientation orientation.
Precondition: orientation CGAL_COLLINEAR.

CGAL_Circle_2<R> circle ( CGAL_Point_2<R> center,
CGAL_Orientation orientation = CGAL_COUNTERCLOCKWISE);
introduces a variable circle of type CGAL_Circle_2<R>. It is initialized to the circle with center center, squared radius zero and orientation orientation.
Precondition: orientation CGAL_COLLINEAR.
Postcondition: \ccVar.is_degenerate() = true.

Access Functions

CGAL_Point_2<R> circle.center () returns the center of circle.
R::FT circle.squared_radius ()
returns the squared radius of circle.
CGAL_orientation circle.orientation ()
returns the orientation of circle.

Equality Tests

bool circle == circle2 returns true, iff circle and circle2 are equal, i.e. if they have the same center, same squared radius and same orientation.
bool circle != circle2 returns true, iff circle and circle2 are not equal.

Predicates

bool circle.is_degenerate ()
returns true, iff circle is degenerate, i.e. if circle has squared radius zero.
CGAL_Oriented_side circle.oriented_side ( CGAL_Point_2<R> p)
returns either the constant CGAL_ON_ORIENTED_BOUNDARY, CGAL_ON_POSITIVE_SIDE, or CGAL_ON_NEGATIVE_SIDE, iff p lies on the boundary, properly on the positive side, or properly on the negative side of circle, resp.
CGAL_Bounded_side circle.bounded_side ( CGAL_Point_2<R> p)
returns CGAL_ON_BOUNDED_SIDE, CGAL_ON_BOUNDARY, or CGAL_ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of circle, resp.
bool circle.has_on_positive_side ( Point p)
returns true, iff p lies properly on the positive side of circle.
bool circle.has_on_negative_side ( Point p)
returns true, iff p lies properly on the negative side of circle.
bool circle.has_on_boundary ( Point p)
returns true, iff p lies on the boundary of circle.
bool circle.has_on_bounded_side ( Point p)
returns true, iff p lies properly inside circle.
bool circle.has_on_unbounded_side ( Point p)
returns true, iff p lies properly outside of circle.

Miscellaneous

CGAL_Circle_2<R> circle.opposite () returns the circle with the same center and squared radius as circle but with opposite orientation.
CGAL_Circle_2<R>
circle.orthogonal_transform ( CGAL_Aff_transformation_2<R> at)
returns the circle obtained by applying at on circle.
Precondition: at is an orthogonal transformation.
CGAL_Bbox_2 circle.bbox () returns a bounding box containing circle.


Return to chapter: 2D Curved Objects
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. Wed, January 20, 1999.