Subject: CGAL users discussion list
List archive
- From: "Thomas Zangl - Home" <>
- To: <>
- Subject: [cgal-discuss] Sphere-Line Intersection
- Date: Thu, 3 Jul 2008 20:48:15 +0200
Dear List,
I need to implement a Sphere-Line intersection which returns the
intersection points.
Is there anything exact already in CGAL hidden, which I am not able to
find? :-)
If no, does somebody have such a construction which does not use any
sqrt or at least computes the sqrt using exact arithmetic?
I already have an implementation. However, look at this fragment:
if (i>0)
{
// first intersection
mu = (-b + sqrt(to_double(b*b - 4*a*c ))) / (2*a);
x = x1 + mu*(x2-x1);
y = y1 + mu*(y2-y1);
z = z1 + mu*(z2-z1);
vIntersections.push_back(Point(x,y,z));
// second intersection
mu = (-b - sqrt(to_double(b*b - 4*a*c ))) / (2*a);
x = x1 + mu*(x2-x1);
y = y1 + mu*(y2-y1);
z = z1 + mu*(z2-z1);
vIntersections.push_back(Point(x,y,z));
return;
}
As you can see, it requires the sqrt of the term "(b*b - 4*a*c )"
which introduces some inaccuracy. Can I get rid of it? The intersection
routine is based on
http://ozviz.wasp.uwa.edu.au/~pbourke/geometry/sphereline/.
Has anybody something better? TIA!
Best regards,
--
,yours Thomas Zangl, Bakk.rer.soc.oec. -
-
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -
- http://blog.tzis.net -
- [cgal-discuss] Sphere-Line Intersection, Thomas Zangl - Home, 07/03/2008
- Re: [cgal-discuss] Sphere-Line Intersection, Pedro Machado Manhães de Castro, 07/03/2008
- Re:[cgal-discuss] Sphere-Line Intersection, Thomas Zangl - Home, 07/03/2008
- Re: [cgal-discuss] Sphere-Line Intersection, Pedro Machado Manhães de Castro, 07/03/2008
- Re:[cgal-discuss] Sphere-Line Intersection, Thomas Zangl - Home, 07/04/2008
- Re: [cgal-discuss] Sphere-Line Intersection, Eric Berberich, 07/04/2008
- [cgal-discuss] consistent cell normals, dfwang, 07/08/2008
- Re: [cgal-discuss] consistent cell normals, Andreas Fabri, 07/08/2008
- Re: [cgal-discuss] consistent cell normals, Rafael Roberto, 07/08/2008
- Re: [cgal-discuss] consistent cell normals, Andreas Fabri, 07/08/2008
- Re:[cgal-discuss] Sphere-Line Intersection, Thomas Zangl - Home, 07/04/2008
- Re: [cgal-discuss] Sphere-Line Intersection, Pedro Machado Manhães de Castro, 07/03/2008
- Re:[cgal-discuss] Sphere-Line Intersection, Thomas Zangl - Home, 07/03/2008
- Re: [cgal-discuss] Sphere-Line Intersection, Pedro Machado Manhães de Castro, 07/03/2008
Archive powered by MHonArc 2.6.16.