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
27 Jun 2024 17:37:45 EDT (-0400)
  Re: Coordinates of a point knowing 3 points and 3 distances  
From: Luc H 
Date: 29 Mar 2012 16:40:00
Message: <web.4f74c711790e9ffba2302ac00@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
>
> 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

I totally agree !
And yes, I know there is 2 solutions (logical !)
BUT my problem is to compute this in POV, not on a paper :s

Example I have 3 points :
P1 <1,0,1>
P2 <4,1,3>
P3 <-1,-2,-1>

Distances :
||P1-P4|| = 3
||P2-P4|| = 5
||P3-P4|| = 2.5

I used the well known formula :

Then I rotate my point at distance 3 with the alpha angle.
The same for Y and Z rotation.
I thought it would work, but...  :'(

The other problem : this should be done in a POV macro.

Note for Le Forgeron : I'd like to restart an old work done by J.C Marteau
http://sibylone.free.fr/index.php?sub=repartition&lang=en
His repartition macro is excellent but can be optimised.

I thought about finding 3 points in an object then use a recursive macro to find
a 4th point, reuse this 4th point to get a 5th and so on...

JC used a random intensive approach which is costly but gives very good results.
http://sibylone.free.fr/povimg/planet_jewel_main.jpg
http://sibylone.free.fr/index.php?sub=repartition&lang=en&gal=g_extra_rep&img=puit_jewel2

I used another method to do the same, but it was 8 times longer.
Good results, anyway :
http://dilatt.free.fr/pov/povrep_01.png
http://dilatt.free.fr/pov/povrep_03.png

And as I need intensive repartitions in an animation, I need a faster macro :)


Post a reply to this message

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