POV-Ray : Newsgroups : povray.advanced-users : Pappus Chain Server Time
21 Nov 2024 17:34:01 EST (-0500)
  Pappus Chain (Message 35 to 44 of 44)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Pappus Chain
Date: 19 Jun 2024 09:20:00
Message: <web.6672da803bd24dfede5e631125979125@news.povray.org>
MichaelJF <fri### [at] t-onlinede> wrote:

> somewhat crazy, but very interesting;)

Aw, thanks Michael!

But what about the render?    :D


Post a reply to this message

From: William F Pokorny
Subject: Re: Pappus Chain
Date: 19 Jun 2024 09:36:14
Message: <6672dece$1@news.povray.org>
On 6/19/24 09:17, Bald Eagle wrote:
> MichaelJF <fri### [at] t-onlinede> wrote:
> 
>> somewhat crazy, but very interesting;)
> 
> Aw, thanks Michael!
> 
> But what about the render?    :D
> 

You have too much free times... :-) Very cool.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 19 Jun 2024 09:55:00
Message: <web.6672e21b3bd24dfede5e631125979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Just posting this here for reference.
>
> https://www.johndcook.com/blog/2023/12/19/conformal-map-disk-triangle/
>
> Would be cool to apply this to the gasket to see what pops out - probably a
> Sierpinski Triangle.
>
> Search: conformal mapping of circle to a triangle
>
> - BE

https://www.mathworks.com/matlabcentral/fileexchange/35008-generation-of-random-variates

https://www.mathworks.com/matlabcentral/fileexchange/1844-gaussian-hypergeometric-function

function z=hypergeometric2f1(a,b,c,x,n)
% HYPERGEOMETRIC2F1 Computes the hypergeometric function
% using a series expansion:
%
%    f(a,b;c;x)=
%
%    1 + [ab/1!c]x + [a(a+1)b(b+1)/2!c(c+1)]x^2 +
%    [a(a+1)(a+2)b(b+1)(b+2)/3!c(c+1)(c+2)]x^3 + ...
%
% The series is expanded to n terms
%
% This function solves the Gaussian Hypergeometric Differential Equation:
%
%     x(1-x)y'' + {c-(a+b+1)x}y' - aby = 0
%
% The Hypergeometric function converges only for:
% |x| < 1
% c != 0, -1, -2, -3, ...
%
%
% Comments to:
% Diego Garcia   - d.g### [at] ieeeorg
% Chuck Mongiovi - mon### [at] fastnet
% June 14, 2002
if nargin ~= 5
    error('Usage: hypergeometric2f1(a,b,c,x,n) --> Wrong number of arguments')
end
if (n <= 0 | n ~= floor(n))
    error('Usage: hypergeometric2f1(a,b,c,x,n) --> n has to be a positive
integer')
end
if (abs(x) > 1)
    error('Usage: hypergeometric2f1(a,b,c,x,n) --> |x| has to be less than 1')
end
if (c <= 0 & c == floor(c))
    error('Usage: hypergeometric2f1(a,b,c,x,n) --> c != 0, -1, -2, -3, ...')
end
z = 0;
m = 0;
while (m<n)
    if (m == 0)
        delta = 1;
    else
        delta = delta .* x .* (a + (m - 1)) .* (b + (m-1)) ./ m ./ (c + (m-1));
   end
   z = z + delta;
   m = m + 1;
end


Post a reply to this message

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 20 Jun 2024 07:15:00
Message: <web.66740eee3bd24dfe1f9dae3025979125@news.povray.org>
And of course we needed so good old fashioned crop circles.
(WIP)


Post a reply to this message


Attachments:
Download 'mjf_appolloniancropcircles.png' (828 KB)

Preview of image 'mjf_appolloniancropcircles.png'
mjf_appolloniancropcircles.png


 

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 20 Jun 2024 16:15:00
Message: <web.66748d783bd24dfea959538725979125@news.povray.org>
Any python coders capable of converting this to SDL?

https://people.sc.fsu.edu/~jburkardt/py_src/hyper_2f1/hyper_2f1.py

#! /usr/bin/env python3
#
def hyper_2f1_test ( ):

#*****************************************************************************80
#
## hyper_2f1_test() tests hyper_2f1().
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    21 December 2023
#
#  Author:
#
#    John Burkardt
#
  import platform

  print ( '' )
  print ( 'hyper_2f1_test():' )
  print ( '  Python version: %s' % ( platform.python_version ( ) ) )
  print ( '  Test hyper_2f1().' )

  hyper_2f1_real_test ( )
  hyper_2f1_complex_test ( )
#
#  Terminate.
#
  print ( '' )
  print ( 'hyper_2f1_test():' )
  print ( '  Normal end of execution.' )
  return

def hyper_2f1 ( a, b, c, x ):

#*****************************************************************************80
#
## hyper_2f1() evaluates the hypergeometric 2F1 function.
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    21 December 2023
#
#  Author:
#
#    John Burkardt
#
#  Input:
#
#    real A, B, C: the parameters.
#
#    real or complex X: the argument.
#
#  Output:
#
#    real or complex F: the value of the function.
#
  from scipy.special import hyp2f1

  f = hyp2f1 ( a, b, c, x )

  return f

def hyper_2f1_real_values ( n_data ):

#*****************************************************************************80
#
## hyper_2f1_real_values() returns some values of the hypergeometric 2F1
function.
#
#  Discussion:
#
#    In Mathematica, the function can be evaluated by:
#
#      fx = Hypergeometric2F1 [ a, b, c, x ]
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    13 February 2015
#
#  Author:
#
#    John Burkardt
#
#  Reference:
#
#    Milton Abramowitz, Irene Stegun,
#    Handbook of Mathematical Functions,
#    National Bureau of Standards, 1964,
#    ISBN: 0-486-61272-4,
#    LC: QA47.A34.
#
#    Shanjie Zhang, Jianming Jin,
#    Computation of Special Functions,
#    Wiley, 1996,
#    ISBN: 0-471-11963-6,
#    LC: QA351.C45
#
#    Stephen Wolfram,
#    The Mathematica Book,
#    Fourth Edition,
#    Cambridge University Press, 1999,
#    ISBN: 0-521-64314-7,
#    LC: QA76.95.W65.
#
#    Daniel Zwillinger, editor,
#    CRC Standard Mathematical Tables and Formulae,
#    30th Edition,
#    CRC Press, 1996,
#    ISBN: 0-8493-2479-3,
#    LC: QA47.M315.
#
#  Input:
#
#    integer n_data.  The user sets n_data to 0 before the first call.
#
#  Output:
#
#    integer n_data.  On each call, the routine increments n_data by 1, and
#    returns the corresponding data; when there is no more data, the
#    output value of n_data will be 0 again.
#
#    real A, B, C, X, the parameters.
#
#    real F, the value of the function.
#
  import numpy as np

  n_max = 24

  a_vec = np.array ( ( \
   -2.5, \
   -0.5, \
    0.5, \
    2.5, \
   -2.5, \
   -0.5, \
    0.5, \
    2.5, \
   -2.5, \
   -0.5, \
    0.5, \
    2.5, \
    3.3, \
    1.1, \
    1.1, \
    3.3, \
    3.3, \
    1.1, \
    1.1, \
    3.3, \
    3.3, \
    1.1, \
    1.1, \
    3.3 ))

  b_vec = np.array ( ( \
    3.3, \
    1.1, \
    1.1, \
    3.3, \
    3.3, \
    1.1, \
    1.1, \
    3.3, \
    3.3, \
    1.1, \
    1.1, \
    3.3, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7 ))

  c_vec = np.array ( ( \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
    6.7, \
   -5.5, \
   -0.5, \
    0.5, \
    4.5, \
   -5.5, \
   -0.5, \
    0.5, \
    4.5, \
   -5.5, \
   -0.5, \
    0.5, \
    4.5 ))

  f_vec = np.array ( ( \
    0.72356129348997784913, \
    0.97911109345277961340, \
    1.0216578140088564160, \
    1.4051563200112126405, \
    0.46961431639821611095, \
    0.95296194977446325454, \
    1.0512814213947987916, \
    2.3999062904777858999, \
    0.29106095928414718320, \
    0.92536967910373175753, \
    1.0865504094806997287, \
    5.7381565526189046578, \
    15090.669748704606754, \
   -104.31170067364349677, \
    21.175050707768812938, \
    4.1946915819031922850, \
    1.0170777974048815592E+10, \
   -24708.635322489155868, \
    1372.2304548384989560, \
    58.092728706394652211, \
    5.8682087615124176162E+18, \
   -4.4635010147295996680E+08, \
    5.3835057561295731310E+06, \
    20396.913776019659426 ))

  x_vec = np.array ( ( \
    0.25, \
    0.25, \
    0.25, \
    0.25, \
    0.55, \
    0.55, \
    0.55, \
    0.55, \
    0.85, \
    0.85, \
    0.85, \
    0.85, \
    0.25, \
    0.25, \
    0.25, \
    0.25, \
    0.55, \
    0.55, \
    0.55, \
    0.55, \
    0.85, \
    0.85, \
    0.85, \
    0.85 ))

  if ( n_data < 0 ):
    n_data = 0

  if ( n_max <= n_data ):
    n_data = 0
    a = 0
    b = 0
    c = 0.0
    x = 0.0
    f = 0.0
  else:
    a = a_vec[n_data]
    b = b_vec[n_data]
    c = c_vec[n_data]
    x = x_vec[n_data]
    f = f_vec[n_data]
    n_data = n_data + 1

  return n_data, a, b, c, x, f

def hyper_2f1_real_test ( ):

#*****************************************************************************80
#
## hyper_2f1_real_test() tests hyper_2f1() for real arguments.
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    21 December 2023
#
#  Author:
#
#    John Burkardt
#
  print ( '' )
  print ( 'hyper_2f1_real_test():' )
  print ( '  hyper_2f1() evaluates the hypergeometric function 2F1(A,B,C;X)' )
  print ( '  Check the computation for real arguments X.' )

  n_data = 0

  while ( True ):

    n_data, a, b, c, x, f1 = hyper_2f1_real_values ( n_data )

    if ( n_data == 0 ):
      break

    f2 = hyper_2f1 ( a, b, c, x )

    print ( '' )
    print ( '  (a,b,c,x):   %4d  %4d  %12f  %12f' % ( a, b, c, x ) )
    print ( '  (exact):     %24.16g' % ( f1 ) )
    print ( '  (computed):  %24.16g' % ( f2 ) )
    print ( '  (error):     %24.16g' % ( abs ( f1 - f2 ) ) )

  return

def hyper_2f1_complex_values ( n_data ):

#*****************************************************************************80
#
## hyper_2f1_complex_values() returns some values of the hypergeometric 2F1
function.
#
#  Discussion:
#
#    In Mathematica, the function can be evaluated by:
#
#      fz = Hypergeometric2F1 [ a, b, c, z ]
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    19 December 2023
#
#  Author:
#
#    John Burkardt
#
#  Reference:
#
#    Shanjie Zhang, Jianming Jin,
#    Computation of Special Functions,
#    Wiley, 1996,
#    ISBN: 0-471-11963-6,
#    LC: QA351.C45
#
#  Input:
#
#    integer n_data.  The user sets n_data to 0 before the first call.
#
#  Output:
#
#    integer n_data.  On each call, the routine increments n_data by 1, and
#    returns the corresponding data; when there is no more data, the
#    output value of n_data will be 0 again.
#
#    real A, B, C: the parameters.
#
#    complex Z: the argument.
#
#    complex FZ: the value of the function.
#
  import numpy as np

  n_max = 15

  a_vec = np.array ( ( \
    3.2, \
    3.2, \
   -5.0, \
    3.3, \
   -7.0, \
    4.3, \
    3.3, \
    3.5, \
    3.3, \
    7.0, \
    5.0, \
    3.5, \
    2.1, \
    8.7, \
    8.7 ))

  b_vec = np.array ( ( \
   1.8, \
  -1.8, \
   3.3, \
  -6.0, \
   3.3, \
  -8.0, \
   5.8, \
  -2.4, \
   4.3, \
   5.0, \
   7.0, \
   1.2, \
   5.4, \
   3.2, \
   2.7 ))

  c_vec = np.array ( ( \
   6.7, \
   6.7, \
   6.7, \
   3.7, \
  -3.7, \
  -3.7, \
   6.7, \
   6.7, \
   6.7, \
   4.1, \
   4.1, \
   9.7, \
   9.7, \
   6.7, \
   6.7 ))

  fz_vec = np.array ( ( \
    5.468999154361234+0.00000000j, \
    0.3375063477462785+0.00000000j, \
    116.8274991533609+603.8909562709345j, \
    17620.41819334182+38293.80901310932j, \
   -11772775115.27448-14382285977.20268j, \
    1316118577866.058-101298889382.4362j, \
    1.733055678355656+0.6340102904953357j, \
    0.6476224071999852-0.5211050690999773j, \
   -1.483008322270093+8.374426179451589j, \
   -0.004037609523971226-0.002956632645480181j, \
   -0.004037609523971226-0.002956632645480181j, \
    1.034313610729953+0.5447389238499308j, \
    0.6885043978280027+1.227418679098749j, \
   -0.9004649679297319-1.11988994714304j, \
   -0.4608388640599718-0.5457569650549665j ))

  z_vec = np.array ( ( \
   1.0+0.0j, \
   1.0+0.0j, \
   5.2+4.8j, \
   5.2-4.8j, \
   5.2-4.8j, \
   5.2+4.8j, \
   0.2+0.1j, \
   0.2+0.5j, \
   0.8+0.3j, \
   3.0-1.0j, \
   3.0-1.0j, \
   0.6+0.9j, \
   0.5+0.7j, \
   0.5+0.7j, \
   0.6+0.9j ))

  if ( n_data < 0 ):
    n_data = 0

  if ( n_max <= n_data ):
    n_data = 0
    a = 0
    b = 0
    c = 0.0
    z = 0.0
    fz = 0.0
  else:
    a = a_vec[n_data]
    b = b_vec[n_data]
    c = c_vec[n_data]
    z = z_vec[n_data]
    fz = fz_vec[n_data]
    n_data = n_data + 1

  return n_data, a, b, c, z, fz

def hyper_2f1_complex_test ( ):

#*****************************************************************************80
#
## hyper_2f1_complex_test() tests hyper_2f1() for complex arguments.
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    21 December 2023
#
#  Author:
#
#    John Burkardt
#
  print ( '' )
  print ( 'hyper_2f1_complex_test():' )
  print ( '  Test hyper_2f1() for complex arguments.' )

  n_data = 0

  while ( True ):

    n_data, a, b, c, z, f1 = hyper_2f1_complex_values ( n_data )

    if ( n_data == 0 ):
      break

    f2 = hyper_2f1 ( a, b, c, z )

    print ( '' )
    print ( '  (a,b,c,z):   %4d  %4d  %8f  (%8f,%8f)' % ( a, b, c, z.real,
z.imag ) )
    print ( '  (exact):     (%24.16g,%24.16g)' % ( f1.real, f1.imag ) )
    print ( '  (computed):  (%24.16g,%24.16g)' % ( f2.real, f2.imag ) )
    print ( '  (error):     %24.16g' % ( abs ( f1 - f2 ) ) )

  return

def timestamp ( ):

#*****************************************************************************80
#
## timestamp() prints the date as a timestamp.
#
#  Licensing:
#
#    This code is distributed under the MIT license.
#
#  Modified:
#
#    06 April 2013
#
#  Author:
#
#    John Burkardt
#
  import time

  t = time.time ( )
  print ( time.ctime ( t ) )

  return

if ( __name__ == '__main__' ):
  timestamp ( )
  hyper_2f1_test ( )
  timestamp ( )


Post a reply to this message

From: MichaelJF
Subject: Re: Pappus Chain
Date: 24 Jul 2024 14:31:53
Message: <66a14899@news.povray.org>
In my opinion, a special case was still missing here...

Blue is an osculatory sphere packing with an asymmetric start 
configuration, red is a classical apollonian sphere packing with a 
symmetric start configuration.

Best regards,
MIchael


Post a reply to this message


Attachments:
Download '20240724_apollonian_spheres_01b_1920.png' (528 KB)

Preview of image '20240724_apollonian_spheres_01b_1920.png'
20240724_apollonian_spheres_01b_1920.png


 

From: kurtz le pirate
Subject: Re: Pappus Chain
Date: 26 Jul 2024 02:38:48
Message: <66a34478$1@news.povray.org>
On 24/07/2024 20:31, MichaelJF wrote:
> In my opinion, a special case was still missing here...
> 
> Blue is an osculatory sphere packing with an asymmetric start 
> configuration, red is a classical apollonian sphere packing with a 
> symmetric start configuration.
> 
> Best regards,
> MIchael
> 

Waouh ! I'm always amazed by these kind of images.

Personally, I've never really understood the transition from plane work
to sphere work.


Excellent



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 27 Jul 2024 12:15:00
Message: <web.66a51c773bd24dfe1f9dae3025979125@news.povray.org>
MichaelJF <fri### [at] t-onlinede> wrote:
> In my opinion, a special case was still missing here...
>
> Blue is an osculatory sphere packing with an asymmetric start
> configuration, red is a classical apollonian sphere packing with a
> symmetric start configuration.
>
> Best regards,
> MIchael


Yes, eventually we had to do the 3D version!
I had some papers on my pile (Well, _one_ of my piles) related to this.

How much more difficult was it to do the spherical space-filling version?


I'm also curious if this can be massaged into a macro that is capable of filling
any given arbitrary shape.

Then we could use it to build stone walls, layered geologic strata, sandstone
sculptures, etc.

Do a test scene with smooth spheres, and then enhance it by replacing them all
with isosurface rocks, pebbles, and sand.

A bowl of grapes.   That sort of thing.   :)


Excellent work - you ought to be proud.

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 27 Jul 2024 12:25:00
Message: <web.66a51e9b3bd24dfe1f9dae3025979125@news.povray.org>
I plugged a prompt into the AI at work, just to see what sort of quality the
code and algorithms the thing spit out - and they're not all that terrible.

So I got some Ford Circles worked out (not using inversion).


Now, even this small experiment taught me some things.

spherical warp requires "orientation" and "dist_exp" to work properly,
especially as an interior_texture - otherwise you just get bad results.


And somehow, there may be a bug somewhere, or I'm just picking up some oddity in
the way the scene elements interact with each other - because I'm getting odd
"checkering" on that left-hand large sphere.   The crackle normal gets
flattened/canceled out.

If I remove the large, enclosing checkered sphere, it goes away.

Enjoy.

// ------------------------------------------------------------------------


#version 3.8;
global_settings {
 assumed_gamma 1.0
}
//#default {finish {emission 1}}
#declare E = 0.00001;

camera {
 location <0.5, 0.5, -1.75>
 right x*image_width/image_height
 up y
 look_at <0.5, 0.5, 0>
}

//sky_sphere {pigment {rgb 1}}
#declare BW = pigment_map
{
 [0 rgb 0]
 [1 rgb 1]
}

sphere {0, 1000 texture {pigment {checker rgb 0 rgb 1 scale x*0.5 warp
{spherical orientation y dist_exp 0.75} scale 1 }} } //interior_texture {pigment
{checker  scale 1 }} }

light_source {<5, 5, -50> rgb 1}

#declare Line = 0.001;

#declare Seed1 = seed (123);
#declare Seed2 = seed (456123);
#declare Seed3 = seed (456123789);

#macro FordCircle (p, q, mode)
 #local R1 = rand (Seed1);
 #local R2 = rand (Seed2);
 #local R3 = rand (Seed3);
 #local Color = <R1, R2, R3>;

 #local Radius = 1 / (2*pow(q,2));
 #local Center = <p/q, Radius, 0>;

 #switch (mode)
 #case (0)
  torus {Radius, Line pigment {rgb y} rotate x*90 translate Center}
  torus {Radius, Line pigment {rgb y} rotate x*90 translate <1, -1, 1>*Center
translate y*1}
 #break
 #case (1)
  disc {Center, z, Radius, 0 pigment {rgb Color}}
  disc {Center, z, Radius, 0 pigment {rgb Color} translate <0, 1-Radius*2, 0>}
 #break
 #case (2)
  sphere {Center, Radius texture {pigment {rgb Color} normal {crackle scale 0.01
bump_size 2} finish {specular 0.4}} }
  sphere {Center, Radius texture {pigment {rgb Color} normal {crackle scale
0.01} finish {specular 0.4}} translate <0, 1-Radius*2, 0>}
 #break
 #end
#end

#macro gcd (a, b)
 #if (b = 0)
  #local Result = a;
 #else
  #local Result = gcd (b, mod (a, b));
 #end
 Result
#end

#declare max_q = 10;

#for (q, 1, max_q)
 #for (p, 0, q)
  #if (gcd (p, q) = 1)
   FordCircle (p, q, 2)
  #end
 #end
#end


Post a reply to this message


Attachments:
Download 'fordcircles_ai.png' (824 KB)

Preview of image 'fordcircles_ai.png'
fordcircles_ai.png


 

From: Bald Eagle
Subject: Re: Pappus Chain
Date: 1 Aug 2024 12:20:00
Message: <web.66abb54d3bd24dfe6563700825979125@news.povray.org>
MichaelJF <fri### [at] t-onlinede> wrote:
> In my opinion, a special case was still missing here...
>
> Blue is an osculatory sphere packing with an asymmetric start
> configuration, red is a classical apollonian sphere packing with a
> symmetric start configuration.
>
> Best regards,
> MIchael

https://www.josleys.com/articles/Sphere_inversion_Article.pdf


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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