Skip to Content.
Sympa Menu

cgal-discuss - Re:[cgal-discuss] Sphere-Line Intersection

Subject: CGAL users discussion list

List archive

Re:[cgal-discuss] Sphere-Line Intersection


Chronological Thread 
  • From: "Thomas Zangl - Home" <>
  • To: "cgal-discuss" <>
  • Subject: Re:[cgal-discuss] Sphere-Line Intersection
  • Date: Fri, 4 Jul 2008 08:32:53 +0200


Am Thu, 3 Jul 2008 22:57:58 +0200, schrieb "Pedro_Machado_Manhães_de_Castro"
<>:

Hi!

>typedef typename Kernel::FT                                 FT;
>typedef typename Root_of_traits< FT >::RootOf_2 Root_of_2;
>
>const Root_of_2 mu = make_root_of_2(-b/(2*a), FT(1), (b*b - 4*a*c)/(4*a*a));
>const Root_of_2 x = x1 + mu*(x2-x1);
>const Root_of_2 y = y1 + mu*(y2-y1);
>const Root_of_2 z = z1 + mu*(z2-z1);
>
>Note: You can&#39;t store them as coordinates for points.
>You may want to have a look at CORE::Expr (slow) if you need absolutely to
>work with CGAL points.
>Otherwise, you have to find another way to store them. Just remember that
>whenever using FT&#39;s like Gmpq or MP_Float, you are using something that
>do not support Root_of_2 (rationals do not include them), and the
>correspondent Points will not support as well.

I already suspected something like this. At least, any ideas how I can
improve accuracy of my intersection code?

The result should be a Point_3 based on Gmpq.

TIA,
--
,yours Thomas Zangl, Bakk.rer.soc.oec. -

-
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -
- http://blog.tzis.net -



Archive powered by MHonArc 2.6.16.

Top of Page