Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Sources   Namespace Members   Compound Members   File Members  

delaunay::triangle Class Reference

A triangle. More...

#include <delaunay.h>

List of all members.


Public Members

 triangle ( const vector2 &v0, const vector2 &v1, const vector2 &v2 )
Construct a triangle from the three points at its corners. More...

 triangle ( const triangle &t )
Copy a triangle. More...

 ~triangle (void)
const vector2vertex ( const unsigned i ) const
Get one of the points at the corners of the triangle. More...

const vector2circumcentre (void) const
Get the circumcentre of the triangle. More...

const double circumradius (void) const
Get the circumradius of the triangle. More...

bool circumcircle_contains ( const vector2 &p ) const
Calculate whether the circumcircle of the triangle contains a given point. More...


Friends

bool operator== ( const triangle &a, const triangle &b )
Compare two triangle objects for equality. More...


Detailed Description

A triangle.

Each triangle is represented by its three corner points.

This class includes member functions pertaining to the circumcircle of the triangle. The circumcircle is the circle that passes through the three corners of the triangle. The circumcircle is used in the definition and calculation of the Delaunay triangulation of a set of points.

Implementation:
This class uses the matrix2x2 class.

Definition at line 126 of file delaunay.h.


Member Function Documentation

delaunay::triangle::triangle (const vector2 & v0, const vector2 & v1, const vector2 & v2)

Construct a triangle from the three points at its corners.

Parameters:
v0   one of the corners of the triangle
v1   one of the corners of the triangle
v2   one of the corners of the triangle

Postconditions:
 assert( this->vertex(0) == v0 );
 assert( this->vertex(1) == v1 );
 assert( this->vertex(2) == v2 );

Definition at line 38 of file delaunay.cpp.

delaunay::triangle::triangle (const triangle & t)

Copy a triangle.

Parameters:
t   the triangle to copy

Postconditions:
 assert( *this == t );

Definition at line 57 of file delaunay.cpp.

delaunay::triangle::~triangle (void) [inline]

Definition at line 541 of file delaunay.h.

const vector2 & delaunay::triangle::vertex (const unsigned i) const [inline]

Get one of the points at the corners of the triangle.

Parameters:
i   which of the three corners to get
Returns:
the requested corner

Preconditions:
 assert( 0 <= 1 && i <= 2 );

Definition at line 548 of file delaunay.h.

const vector2 & delaunay::triangle::circumcentre (void) const [inline]

Get the circumcentre of the triangle.

The circumcentre is the centre of the circumcircle.

Returns:
the circumcentre

Definition at line 559 of file delaunay.h.

const double delaunay::triangle::circumradius (void) const

Get the circumradius of the triangle.

The circumradius is the radius of the circumcircle.

Returns:
the circumcentre

Definition at line 69 of file delaunay.cpp.

bool delaunay::triangle::circumcircle_contains (const vector2 & p) const

Calculate whether the circumcircle of the triangle contains a given point.

Parameters:
p   the point to test
Returns:
true iff the circumcircle contains p

Definition at line 76 of file delaunay.cpp.


Friends And Related Function Documentation

bool operator== (const triangle & a, const triangle & b) [friend]

Compare two triangle objects for equality.

Parameters:
a   one of the two triangle objects to compare
b   the other triangle object
Returns:
true iff the two triangle objects are equal

Invariants:
The ordering of the three points that define the triangle is not important:
 assert( triangle(a, b, c) == triangle(a, b, c) );
 assert( triangle(a, b, c) == triangle(b, c, a) );
 assert( triangle(a, b, c) == triangle(c, a, b) );
Otherwise, two triangle objects are not equal.

The documentation for this class was generated from the following files:
Generated at Sun Jul 14 20:38:17 2002 for Mapper by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999