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

2D Circle (Circle_2)

Definition

An object of type Circle_2<R> is a circle in the two-dimensional Euclidean plane 2. The circle is oriented, i.e. its boundary has clockwise or counterclockwise orientation. The boundary splits 2 into a positive and a negative side, where the positive side is to the left of the boundary. The boundary further splits 2 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

Circle_2<R> circle ( Point_2<R> center,
R::FT squared_radius,
Orientation orientation = COUNTERCLOCKWISE);
introduces a variable circle of type Circle_2<R>. It is initialized to the circle with center center, squared radius squared_radius and orientation orientation.
Precondition: orientation COLLINEAR, and further, squared_radius 0.


Circle_2<R> circle ( Point_2<R> p, Point_2<R> q, Point_2<R> r);
introduces a variable circle of type 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.


Circle_2<R> circle ( Point_2<R> p,
Point_2<R> q,
Orientation orientation = COUNTERCLOCKWISE);
introduces a variable circle of type Circle_2<R>. It is initialized to the circle with diameter pq and orientation orientation.
Precondition: orientation COLLINEAR.


Circle_2<R> circle ( Point_2<R> center,
Orientation orientation = COUNTERCLOCKWISE);
introduces a variable circle of type Circle_2<R>. It is initialized to the circle with center center, squared radius zero and orientation orientation.
Precondition: orientation COLLINEAR.
Postcondition: circle.is_degenerate() = true.

Access Functions

Point_2<R> circle.center () returns the center of circle.

R::FT circle.squared_radius ()
returns the squared radius of circle.

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.

Oriented_side circle.oriented_side ( Point_2<R> p)
returns either the constant ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE, or ON_NEGATIVE_SIDE, iff p lies on the boundary, properly on the positive side, or properly on the negative side of circle, resp.

Bounded_side circle.bounded_side ( Point_2<R> p)
returns ON_BOUNDED_SIDE, ON_BOUNDARY, or ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of circle, resp.

bool circle.has_on_positive_side ( Point_2<R> p)
bool circle.has_on_negative_side ( Point_2<R> p)
bool circle.has_on_boundary ( Point_2<R> p)
bool circle.has_on_bounded_side ( Point_2<R> p)
bool circle.has_on_unbounded_side ( Point_2<R> p)

Miscellaneous

Circle_2<R> circle.opposite () returns the circle with the same center and squared radius as circle but with opposite orientation.

Circle_2<R>
circle.orthogonal_transform ( Aff_transformation_2<R> at)
returns the circle obtained by applying at on circle.
Precondition: at is an orthogonal transformation.

Bbox_2 circle.bbox () returns a bounding box containing circle.


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.