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

2D Optimisation Ellipse (CGAL_Optimisation_ellipse_2)

Definition

An object of the class CGAL_Optimisation_ellipse_2<R> is an ellipse in the two-dimensional Euclidean plane E2. Its boundary splits E2 into a bounded and an unbounded side. Note that the ellipse can be degenerate, i.e. it can be empty, equal to a single point or equal to a segment. By definition, an empty CGAL_Optimisation_ellipse_2<R> has no boundary and no bounded side, i.e. its unbounded side equals the whole plane E2. A CGAL_Optimisation_ellipse_2<R> equal to a single point p or equal to a segment s, resp., has no bounded side, its boundary is {p} or s, resp., and its unbounded side equals E2-{p} or E2-s, resp.

#include <CGAL/Optimisation_ellipse_2.h>

Types

typedef CGAL_Point_2<R>
Point; Point type.

Creation

void ellipse.set () sets ellipse to the empty ellipse.
void ellipse.set ( CGAL_Point_2<R> p)
sets ellipse to the ellipse equal to the single point p.
void ellipse.set ( CGAL_Point_2<R> p, CGAL_Point_2<R> q)
sets ellipse to the ellipse equal to the segment connecting p and q.
Precondition: p and q are distinct.
void
ellipse.set ( CGAL_Point_2<R> p1,
CGAL_Point_2<R> p2,
CGAL_Point_2<R> p3)
sets ellipse to the ellipse of smallest area through p1, p2 and p3.
Precondition: p1,p2,p3 are not collinear.
void
ellipse.set ( CGAL_Point_2<R> p1,
CGAL_Point_2<R> p2,
CGAL_Point_2<R> p3,
CGAL_Point_2<R> p4)
sets ellipse to the ellipse of smallest area through p1, p2, p3 and p4.
Precondition: p1,p2,p3, p4 are in convex position.
void
ellipse.set ( CGAL_Point_2<R> p1,
CGAL_Point_2<R> p2,
CGAL_Point_2<R> p3,
CGAL_Point_2<R> p4,
CGAL_Point_2<R> p5)
sets ellipse to the unique ellipse through p1, p2, p3, p4 and p5.
Precondition: There exists an ellipse through p1,p2,p3,p4,p5.

Access Functions

int ellipse.number_of_boundary_points ()
returns the number of boundary points that define ellipse.

Equality Tests

bool ellipse == ellipse2
returns true, iff ellipse and ellipse2 are equal.
bool ellipse != ellipse2
returns true, iff ellipse and ellipse2 are not equal.

Predicates

CGAL_Bounded_side ellipse.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 ellipse, resp.
bool ellipse.has_on_bounded_side ( CGAL_Point_2<R> p)
returns true, iff p lies properly inside ellipse.
bool ellipse.has_on_boundary ( CGAL_Point_2<R> p)
returns true, iff p lies on the boundary of ellipse.
bool ellipse.has_on_unbounded_side ( CGAL_Point_2<R> p)
returns true, iff p lies properly outside of ellipse.
bool ellipse.is_empty ()
returns true, iff ellipse is empty (this implies degeneracy).
bool ellipse.is_degenerate ()
returns true, iff ellipse is degenerate, i.e. if ellipse is empty, equal to a single point or equal to a segment.

I/O

ostream& ostream& os << ellipse
writes ellipse to output stream os.
istream& istream& is >> & ellipse
reads ellipse from input stream is.

#include <CGAL/IO/Window_stream.h>

CGAL_Window_stream&
CGAL_Window_stream& ws << ellipse
writes ellipse to window stream ws.


Next: Class declaration of CGAL_Min_ellipse_2_traits_2<R>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.