radical line as well

This commit is contained in:
Pedro Machado Manhaes de Castro
2008-10-20 14:44:37 +00:00
parent d3e4a80171
commit a65aceddf2
5 changed files with 42 additions and 1 deletions
@@ -2944,6 +2944,32 @@ namespace CartesianKernelFunctors {
{ return h.rep().projection(p); }
};
template <class K>
class Construct_radical_line_2
{
typedef typename K::Line_2 Line_2;
typedef typename K::Circle_2 Circle_2;
typedef typename K::FT FT;
public:
typedef Line_2 result_type;
result_type
operator() (const Circle_2 & c1, const Circle_2 & c2) const
{
// Concentric Circles don't have radical line
CGAL_kernel_precondition (c1.center() != c2.center());
const FT a = 2*(c2.center().x() - c1.center().x());
const FT b = 2*(c2.center().y() - c1.center().y());
const FT c = CGAL::square(c1.center().x()) +
CGAL::square(c1.center().y()) - c1.squared_radius() -
CGAL::square(c2.center().x()) -
CGAL::square(c2.center().y()) + c2.squared_radius();
return Line_2(a, b, c);
}
};
template <class K>
class Construct_radical_plane_3
{