This commit is contained in:
Sébastien Loriot 2010-11-12 14:11:05 +00:00
parent 04482d4a54
commit c9f97dac21
1 changed files with 9 additions and 9 deletions

View File

@ -5,30 +5,30 @@
typedef CGAL::Simple_cartesian<double> K1; typedef CGAL::Simple_cartesian<double> K1;
typedef CGAL::Simple_cartesian<CGAL::Quotient<CGAL::MP_Float> > K2; typedef CGAL::Simple_cartesian<CGAL::Quotient<CGAL::MP_Float> > K2;
typedef CGAL::Cartesian_converter<K1,K2> K1_2_K2; typedef CGAL::Cartesian_converter<K1,K2> K1_to_K2;
typedef CGAL::Cartesian_converter<K2,K1> K2_2_K1; typedef CGAL::Cartesian_converter<K2,K1> K2_to_K1;
int main(){ int main(){
K1::Triangle_3 t_i( K1::Triangle_3 t1(
K1::Point_3(0.,0.,0.), K1::Point_3(0.,0.,0.),
K1::Point_3(1.,0.,-1.), K1::Point_3(1.,0.,-1.),
K1::Point_3(0.,1.,3.) K1::Point_3(0.,1.,3.)
); );
K1::Line_3 l_i( K1::Line_3 l1(
K1::Point_3(0.2,0.25,-7), K1::Point_3(0.2,0.25,-7),
K1::Point_3(0.25,0.3,4) K1::Point_3(0.25,0.3,4)
); );
K1_2_K2 to_exact; K1_to_K2 to_exact;
K2::Triangle_3 t_1=to_exact(t_i); K2::Triangle_3 t2=to_exact(t1);
K2::Line_3 l_e=to_exact(l_i); K2::Line_3 l2=to_exact(l1);
CGAL::Object inter=CGAL::intersection(t_e,l_e); CGAL::Object inter=CGAL::intersection(t2,l2);
K2::Point_3 exact_pt=CGAL::object_cast<K2::Point_3>(inter); K2::Point_3 exact_pt=CGAL::object_cast<K2::Point_3>(inter);
K2_2_K1 to_inexact; K2_to_K1 to_inexact;
K1::Point_3 approx_pt = to_inexact(exact_pt); K1::Point_3 approx_pt = to_inexact(exact_pt);
return 0; return 0;