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

2D Optimisation Ellipse (Optimisation_ellipse_2)

Definition

An object of the class Optimisation_ellipse_2<R> is an ellipse in the two-dimensional Euclidean plane 2. Its boundary splits 2 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 Optimisation_ellipse_2<R> has no boundary and no bounded side, i.e. its unbounded side equals the whole plane 2. A 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 2-{p} or 2-s, resp.

#include <CGAL/Optimisation_ellipse_2.h>

Types

typedef Point_2<R> Point; Point type.

Creation

void ellipse.set () sets ellipse to the empty ellipse.

void ellipse.set ( Point_2<R> p)
sets ellipse to the ellipse equal to the single point p.

void ellipse.set ( Point_2<R> p, 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 ( Point_2<R> p1,
Point_2<R> p2,
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 ( Point_2<R> p1,
Point_2<R> p2,
Point_2<R> p3,
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 ( Point_2<R> p1,
Point_2<R> p2,
Point_2<R> p3,
Point_2<R> p4,
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 defining ellipse.

Equality Tests

bool ellipse == ellipse2
returns true, iff ellipse and ellipse2 are equal, i.e. if both ellipses were constructed from the same set of points.

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

Predicates

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

bool ellipse.has_on_bounded_side ( Point_2<R> p)
returns true, iff p lies properly inside ellipse.

bool ellipse.has_on_boundary ( Point_2<R> p)
returns true, iff p lies on the boundary of ellipse.

bool ellipse.has_on_unbounded_side ( 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>

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


Next: Class declaration of Min_ellipse_2_traits_2<R>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.