Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Calculating position of point in space ?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Calculating position of point in space ?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Calculating position of point in space ?
  • Date: Fri, 03 Feb 2012 14:02:03 +0100

Actually you can use the weighted circumcenter of 4 weighted points.
If the spheres intersect exactly in one point this is exact.

Something like that should work and be fast:

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Regular_triangulation_euclidean_traits_3<Kernel> RT;
typedef RT::Weighted_point_3 Weighted_point_3;
typedef Kernel::Point_3 Point_3;

Weighted_point_3 w1(Point_3(x0,y0,z0),r0*r0);//weight is squared distance
... same for w2,w3,w4

Point_3 p = RT::Construct_weighted_circumcenter_3()(w1,w2,w3,w4);

see:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_3_ref/Class_Regular_triangulation_euclidean_traits_3.html#Nested_type_Construct_weighted_circumcenter_3
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_3/Chapter_main.html#Section_38.3

Sebastien.

On 02/03/2012 01:18 PM, Adam wrote:
Sebastien,

Thank you for your replay.
In truth distances from 4 known points will be with some error and will
never intersect exactly where they should. I think that intersections from
pairs of spheres then circles will give number of points – some of them will
be incorrect but correct ones will produce a form in space and center of
mass of this form will give me coordination’s of point I’m looking for –
with some error of course.
In your replay you point out that CGAL might not be the best solution for
this - do you have some other ideas?
I would prefer not to spend long time on writing a solution of this problem
if there is already existing one.

Regards
Adam




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Calculating-position-of-point-in-space-tp4353924p4354449.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.16.

Top of Page