#include <CGAL/Min_circle_2_adapterC2.h>
| |
Data accessor for Cartesian coordinates.
| |
| |
Point type.
| |
| |
Circle type.
|
| |||
|
|
| |
returns constants CGAL_LEFTTURN, CGAL_COLLINEAR, or CGAL_RIGHTTURN iff r lies properly to the left, on, or properly to the right of the oriented line through p and q, resp. |
Note: In this release correct results are only guaranteed if exact arithmetic is used, so this example (using inexact floating-point arithmetic) is only intended to illustrate the techniques.
#include <CGAL/Min_circle_2_adapterC2.h> #include <CGAL/Min_circle_2.h> // your own point class (Cartesian) class PtC { // ... public: PtC( double x, double y); double x( ) const; double y( ) const; // ... }; // the data accessor for PtC class PtC_DA { public: typedef double FT; void get( const PtC& p, double& x, double& y) const { x = p.x(); y = p.y(); } double get_x( const PtC& p) const { return( p.x()); } double get_y( const PtC& p) const { return( p.y()); } void set( PtC& p, double x, double y) const { p = PtC( x, y); } }; // some typedefs typedef CGAL_Min_circle_2_adapterC2 < PtC, PtC_DA > AdapterC; typedef CGAL_Min_circle_2 < AdapterC > Min_circle; // do something with Min_circle Min_circle mc( /*...*/ );