POV-Ray : Newsgroups : povray.advanced-users : Pappus Chain : Re: Pappus Chain Server Time
27 Jul 2024 14:32:29 EDT (-0400)
  Re: Pappus Chain  
From: kurtz le pirate
Date: 14 Jun 2024 11:32:43
Message: <666c629b$1@news.povray.org>
A few quick explanations for those interested.
(I'd probably do a page on my site... but I'm so far behind ;) )


I haven't used Bald Eagle's inversion method, which looks very
interesting and promising.


The reference being the WIKIPEDIA page
<https://en.wikipedia.org/wiki/Pappus_chain>



-- The two basic radii :
#declare BigRadius = SIZE; // AB/2
#declare SmallRadius = SIZE*3/4; // AC/2


-- For the first circle (CB):
#declare cx = SmallRadius*2 + BigRadius - SmallRadius;
#declare r = BigRadius - SmallRadius;
DrawCircle(cx, 0, r)


-- Next, a simple loop :
#declare r = SmallRadius/BigRadius;
#declare NthRadius = r;

#declare n = 1;
#while ( NthRadius > MIN_RADIUS )
  #declare divisor = n*n*(1-r)*(1-r)+r;
  #declare xx = 2*BigRadius*r*(1+r)/(2*divisor);
  #declare yy = 2*BigRadius*n*r*(1-r)/divisor;
  #declare NthRadius = 2*BigRadius*r*(1-r)/(2*divisor);

  DrawCircle(xx, +yy, NthRadius)
  DrawCircle(xx, -yy, NthRadius) // symmetrically

  #declare n = n + 1;
#end


The first tests were in 2D. So I made a macro that drew circles :
#macro DrawCircle(X,Y,R,C)
 torus { R, rLine pigment { color C } rotate 90*x translate <X,Y,0> }
#end


Transformed for 3d :
#macro DrawCircle(X,Y,R,C)
 sphere { <X,R,Y>, R pigment { color C } }
#end



A yes, I forgot! The end of the loop is controlled by the constancy
MIN_RADIUS. If the radius is "too" small, we stop.

#declare MIN_RADIUS = 0.50; for the stone spheres





-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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