POV-Ray : Newsgroups : povray.newusers : Coordinates of a point knowing 3 points and 3 distances : Re: Coordinates of a point knowing 3 points and 3 distances Server Time
28 Sep 2024 07:52:14 EDT (-0400)
  Re: Coordinates of a point knowing 3 points and 3 distances  
From: Le Forgeron
Date: 29 Mar 2012 10:16:07
Message: <4f746ea7$1@news.povray.org>
Le 29/03/2012 14:31, Luc H. a écrit :
> Hello
> 
> I have 3 points in space, and I'd like to get the coordinates of a 4th point.
> 
> The known data are
> P1 : <P1.x, P1.y, P1.z>
> P2 : <P2.x, P1.2, P2.z>
> P3 : <P3.x, P1.3, P3.z>
> 
> Distance from point 1 to point 4 : D1
> Distance from point 2 to point 4 : D2
> Distance from point 3 to point 4 : D3
> 
> 
> I tried with some formula (google : "trilateration" and "triangle resolution")
> 
> I could easily do this with 2 known points and 2 distances (on a fixed z plan)
> but no way to get something working in 3D ^^
> 
> Any advice ?
> 

Too many data, nearly!

3 points define a triangle in space.
Each distance to point 4 define a sphere around a corner of that triangle.

From the first two distance, you get the intersection of 2 spheres.
* At worst: no intersection, no point 4.
* At best:, point 4 is on the segment and the intersection is that
single point. (well, check at least with the third distance)
* Usually: intersection of 2 spheres is a circle.

Now use the last sphere (the third distance from the third corner), and
intersect with the previous circle.
* at worst: no common,
* at best: point 4 is on the plane ot the triangle
* usually: you still have 2 candidates, in mirror position from the
plane of the triangle.

If you want it solved as a system of equations directly, you need to
specify the intersection of three spheres not at the origin. That will
gives you 3 spheres equations, all == 0, and you will push them in a
solver...


Notice: x²+y²+z²-1² = 0 is the equation for a sphere at <0,0,0> of radius 1.
The sphere at <i,j,k> of radius r has (x,y,z) matching:
(x-i)²+(y-j)²+(z-k)² - r² = 0


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.