KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
kjb::qd::DoubleCircle Struct Reference

Parameterized circle in the plane. More...

#include <doublecircle.h>

Public Member Functions

 DoubleCircle (double rad, const Vector2 &ctr)
 ctor from a radius and center point More...
 
 DoubleCircle (const Vector2 &p1, const Vector2 &p2, const Vector2 &p3)
 ctor from 3 points More...
 
 DoubleCircle (const Vector2 &p1, const Vector2 &p2)
 ctor from points; OK if they are equal More...
 
void swap (DoubleCircle &that)
 swap representations of two circles More...
 
bool is_degenerate () const
 predicate to test for degeneracy More...
 
bool is_not_degenerate () const
 predicate to test for non-degeneracy More...
 
 DoubleCircle (const std::vector< Vector2 > &)
 compute the smallest enclosing disc More...
 
bool outside_me_is (const Vector2 &query) const
 test whether a query point is outside this object's disc More...
 

Public Attributes

double radius
 distance between center and points of the circle More...
 
Vector2 center
 center of the circle More...
 

Detailed Description

Parameterized circle in the plane.

Constructor & Destructor Documentation

kjb::qd::DoubleCircle::DoubleCircle ( double  rad,
const Vector2 ctr 
)
inline

ctor from a radius and center point

Parameters
radRadius of circle to construct (using its absolute value)
ctrCenter of circle to construct

A negative radius is silently made positive. A zero radius is OK but predicate is_degenerate() will be true.

kjb::qd::DoubleCircle::DoubleCircle ( const Vector2 p1,
const Vector2 p2,
const Vector2 p3 
)

ctor from 3 points

kjb::qd::DoubleCircle::DoubleCircle ( const Vector2 p1,
const Vector2 p2 
)
inline

ctor from points; OK if they are equal

kjb::qd::DoubleCircle::DoubleCircle ( const std::vector< Vector2 > &  pts)

compute the smallest enclosing disc

This algorithm is stochastic, and requires expected linear time. It implements the VERY VERY CLEVER randomized algorithm of Welzl, presented in de Berg, van Kreveld, Overmars, and Schwarzkopf (1999).

Member Function Documentation

bool kjb::qd::DoubleCircle::is_degenerate ( ) const
inline

predicate to test for degeneracy

bool kjb::qd::DoubleCircle::is_not_degenerate ( ) const
inline

predicate to test for non-degeneracy

bool kjb::qd::DoubleCircle::outside_me_is ( const Vector2 query) const
inline

test whether a query point is outside this object's disc

Parameters
queryPoint to test for nonmembership in the disc
Returns
true iff the query point is outside the disc (or that rounding error makes it appear so.
Warning
due to roundoff error, points on the circle itself can produce a true result sometimes.
void kjb::qd::DoubleCircle::swap ( DoubleCircle that)
inline

swap representations of two circles

Member Data Documentation

Vector2 kjb::qd::DoubleCircle::center

center of the circle

double kjb::qd::DoubleCircle::radius

distance between center and points of the circle


The documentation for this struct was generated from the following files: