How to create nice-looking nuclei in TikZ?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
29
down vote

favorite
7












In the responses to Draw Bohr atomic model with electron shells in TeX?, there are nice drawings of atoms. However, the nuclei don't look very appealing or realistic.



I was wondering: Can anyone think of an algorithm to (semi-)automatically (for example in a randomized fashion) create large nuclei that look more realistic as for example the in the image attached?



enter image description here



It seems to be key that the balls are sufficiently spaced and that the spherical look requires more centered balls to be on top. Both requirements are not met with my code:



documentclassstandalone
usepackagetikz

begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite
foreach a in 1,...,200
pgfmathsetmacrorrnd
pgfmathsetmacroarandom(0,360)
pgfmathrandomitemccolor
shade[ball color=c] (a:-r) circle (5pt);

endtikzpicture
enddocument


The result is:
enter image description here







share|improve this question


















  • 1




    "More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
    – Ben Crowell
    Sep 1 at 19:44






  • 1




    Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
    – FlorianL
    Sep 1 at 19:54














up vote
29
down vote

favorite
7












In the responses to Draw Bohr atomic model with electron shells in TeX?, there are nice drawings of atoms. However, the nuclei don't look very appealing or realistic.



I was wondering: Can anyone think of an algorithm to (semi-)automatically (for example in a randomized fashion) create large nuclei that look more realistic as for example the in the image attached?



enter image description here



It seems to be key that the balls are sufficiently spaced and that the spherical look requires more centered balls to be on top. Both requirements are not met with my code:



documentclassstandalone
usepackagetikz

begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite
foreach a in 1,...,200
pgfmathsetmacrorrnd
pgfmathsetmacroarandom(0,360)
pgfmathrandomitemccolor
shade[ball color=c] (a:-r) circle (5pt);

endtikzpicture
enddocument


The result is:
enter image description here







share|improve this question


















  • 1




    "More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
    – Ben Crowell
    Sep 1 at 19:44






  • 1




    Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
    – FlorianL
    Sep 1 at 19:54












up vote
29
down vote

favorite
7









up vote
29
down vote

favorite
7






7





In the responses to Draw Bohr atomic model with electron shells in TeX?, there are nice drawings of atoms. However, the nuclei don't look very appealing or realistic.



I was wondering: Can anyone think of an algorithm to (semi-)automatically (for example in a randomized fashion) create large nuclei that look more realistic as for example the in the image attached?



enter image description here



It seems to be key that the balls are sufficiently spaced and that the spherical look requires more centered balls to be on top. Both requirements are not met with my code:



documentclassstandalone
usepackagetikz

begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite
foreach a in 1,...,200
pgfmathsetmacrorrnd
pgfmathsetmacroarandom(0,360)
pgfmathrandomitemccolor
shade[ball color=c] (a:-r) circle (5pt);

endtikzpicture
enddocument


The result is:
enter image description here







share|improve this question














In the responses to Draw Bohr atomic model with electron shells in TeX?, there are nice drawings of atoms. However, the nuclei don't look very appealing or realistic.



I was wondering: Can anyone think of an algorithm to (semi-)automatically (for example in a randomized fashion) create large nuclei that look more realistic as for example the in the image attached?



enter image description here



It seems to be key that the balls are sufficiently spaced and that the spherical look requires more centered balls to be on top. Both requirements are not met with my code:



documentclassstandalone
usepackagetikz

begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite
foreach a in 1,...,200
pgfmathsetmacrorrnd
pgfmathsetmacroarandom(0,360)
pgfmathrandomitemccolor
shade[ball color=c] (a:-r) circle (5pt);

endtikzpicture
enddocument


The result is:
enter image description here









share|improve this question













share|improve this question




share|improve this question








edited Aug 31 at 20:33









Milo

5,53321345




5,53321345










asked Aug 31 at 18:22









FlorianL

6731511




6731511







  • 1




    "More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
    – Ben Crowell
    Sep 1 at 19:44






  • 1




    Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
    – FlorianL
    Sep 1 at 19:54












  • 1




    "More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
    – Ben Crowell
    Sep 1 at 19:44






  • 1




    Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
    – FlorianL
    Sep 1 at 19:54







1




1




"More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
– Ben Crowell
Sep 1 at 19:44




"More realistic" doesn't really make sense here. It's a quantum-mechanical object, and the wavefunctions all overlap.
– Ben Crowell
Sep 1 at 19:44




1




1




Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
– FlorianL
Sep 1 at 19:54




Agreed, at least in terms of physics. What I was shooting for was spheres somehow bunched together to form a bigger sphere...
– FlorianL
Sep 1 at 19:54










3 Answers
3






active

oldest

votes

















up vote
37
down vote



accepted










Here is a proposal that makes the nucleus look more like a compact ball. It works by building up circular rings starting from the outside in. By adjusting the number of protons/neutrons in each ring and its distance from the center, you can create a ball effect.



enter image description here



documentclassstandalone
usepackagetikz
usepackage[version=4]mhchem
begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite
pgfmathsetseed1
foreach A/R in 25/1,12/0.9,15/0.8,20/0.7,12/0.5,7/0.3,1/0
pgfmathsetmacroS360/A
foreach B in 0,S,...,360
pgfmathrandomitemCcolor
shade[ball color=C] (B+A:R) circle (5pt);


node at (-1,1.3) ce^226_88Ra;
endtikzpicture
enddocument





share|improve this answer


















  • 3




    +1, again excellent work.
    – Sebastiano
    Sep 1 at 1:40










  • Excellent, thanks!
    – FlorianL
    Sep 1 at 19:41

















up vote
13
down vote













Based on your code, I first draw protons/neutrons following a circular pattern three times, at radius 1, 0.5 and 0.2. I also draw random protons/neutrons in between.



documentclassstandalone
usepackagetikz

begindocument
begintikzpicture
path (-2,-2) rectangle (2,2);
pgfmathdeclarerandomlistcolorredwhite

foreach a in 0,10,...,360
pgfmathrandomitemccolor
shade[ball color=c] (a:1) circle (5pt);


foreach a in 0,20,...,360
pgfmathrandomitemccolor
shade[ball color=c] (a:0.5) circle (5pt);


foreach a in 1,...,350
pgfmathsetmacrorrnd
pgfmathsetmacroarandom(0,360)
pgfmathrandomitemccolor
shade[ball color=c] (a:r) circle (5pt);


foreach a in 0,60,...,360
pgfmathrandomitemccolor
shade[ball color=c] (a:0.2) circle (5pt);

endtikzpicture
enddocument


The results is:



Screenshot






share|improve this answer





























    up vote
    7
    down vote













    Here is another version in which the spheres are put on the root lattice of A_3 and allowed to wiggle a bit. More explanations can be found here.



    documentclass[tikz,border=3.14mm]standalone
    usepackagetikz-3dplot
    usetikzlibrary3d
    tikzsetdeclare function=posx(x,y,z)=x-y/2;
    posy(x,y,z)=y/sqrt(2);
    posz(x,y,z)=-y/2+z;

    newsaveboxProton
    newsaveboxNeutron
    sboxProtontikzshade[ball color=red] circle(0.85/sqrt(2));
    sboxNeutrontikzshade[ball color=gray!20] circle(0.85/sqrt(2));
    begindocument
    xdefLst-1, 0, 2, -2, -1, 1,
    0, 0, 2, -1, -1, 1,
    -2, -2, 0, -1, 1, 2,
    -2, 0, 1, 1, 0, 2, 0, -1, 1,
    -1, -2, 0, -2, -3, -1,
    0, 1, 2, -1, 0, 1,
    -2, -1, 0, 1, -1, 1,
    0, -2, 0, -1, -3, -1,
    1, 1, 2, 0, 0, 1, -1, -1, 0,
    -2, -2, -1, 0, 2, 2,
    -1, 1, 1, 2, 1, 2, -2, 0, 0,
    1, 0, 1, 0, -1, 0,
    -1, -2, -1, -2, -3, -2,
    1, 2, 2, 0, 1, 1, -1, 0, 0,
    2, 0, 1, -2, -1, -1,
    1, -1, 0, 0, -2, -1,
    -1, -3, -2, 2, 2, 2,
    1, 1, 1, 0, 0, 0,
    -1, -1, -1, -2, -2, -2,
    1, 3, 2, 0, 2, 1, -1, 1, 0,
    2, 1, 1, -2, 0, -1, 1, 0, 0,
    0, -1, -1, -1, -2, -2,
    2, 3, 2, 1, 2, 1, 0, 1, 0,
    -1, 0, -1, 2, 0, 0,
    -2, -1, -2, 1, -1, -1,
    0, -2, -2, 2, 2, 1, 1, 1, 0,
    0, 0, -1, -1, -1, -2,
    1, 3, 1, 0, 2, 0, -1, 1, -1,
    2, 1, 0, 1, 0, -1,
    0, -1, -2, 2, 3, 1, 1, 2, 0,
    0, 1, -1, -1, 0, -2,
    2, 0, -1, 1, -1, -2,
    2, 2, 0, 1, 1, -1, 0, 0, -2,
    2, 1, -1, 1, 0, -2
    tdplotsetmaincoords-90+109.471-90+70
    foreach X in 1,...,10
    begintikzpicture
    path[use as bounding box] (-3.5,-3.5) rectangle (3.5,3.5);
    draw (0,0) circle (1); % /sqrt(2)
    beginscope[tdplot_main_coords]
    draw[-latex] (0,0,0) coordinate (O) -- (1,0,0) node[right]$alpha_1$;
    draw[-latex] (O) -- (-1/2,1/sqrt(2),-1/2) node[right]$alpha_2$;
    draw[-latex] (O) -- (0,0,1) node[right]$alpha_3$;
    draw[red,-latex] (O) -- (1/2,1/sqrt(2),1/2) node[right]$-theta$;
    foreach Z in Lst
    pgfmathsetmacromyxZ[0]
    pgfmathsetmacromyyZ[1]
    pgfmathsetmacromyzZ[2]
    pgfmathsetmacromydeltax0.1*(rnd-0.5)
    pgfmathsetmacromydeltay0.1*(rnd-0.5)
    pgfmathsetmacromydeltaz0.1*(rnd-0.5)
    pgfmathtruncatemacromycolint(2*rnd)
    ifnummycol=1
    node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
    posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
    posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxNeutron;
    else
    node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
    posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
    posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxProton;
    fi
    endscope
    endtikzpicture
    enddocument


    enter image description here



    Just for fun: more nuclei. And no, it does not look like sphere, but like a set of sphere which are packed with maximum density. This is of course not the same as demanding that the nuclei should fill out a sphere. The latter might translate in the requirement that the sum of distances gets minimized or something like that, which obviously is not the same requirement as maximal packing. I do not know if there is a simple algorithm that minimizes the sum of distances while making sure the spheres do not overlap.



    enter image description here






    share|improve this answer






















    • +1, but somehow this looks not exactly spherical…
      – TeXnician
      Sep 1 at 15:56










    • @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
      – marmot
      Sep 1 at 16:02






    • 1




      Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
      – TeXnician
      Sep 1 at 16:06










    • @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
      – marmot
      Sep 1 at 16:09







    • 1




      @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
      – marmot
      Sep 1 at 20:57










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448733%2fhow-to-create-nice-looking-nuclei-in-tikz%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    37
    down vote



    accepted










    Here is a proposal that makes the nucleus look more like a compact ball. It works by building up circular rings starting from the outside in. By adjusting the number of protons/neutrons in each ring and its distance from the center, you can create a ball effect.



    enter image description here



    documentclassstandalone
    usepackagetikz
    usepackage[version=4]mhchem
    begindocument
    begintikzpicture
    path (-2,-2) rectangle (2,2);
    pgfmathdeclarerandomlistcolorredwhite
    pgfmathsetseed1
    foreach A/R in 25/1,12/0.9,15/0.8,20/0.7,12/0.5,7/0.3,1/0
    pgfmathsetmacroS360/A
    foreach B in 0,S,...,360
    pgfmathrandomitemCcolor
    shade[ball color=C] (B+A:R) circle (5pt);


    node at (-1,1.3) ce^226_88Ra;
    endtikzpicture
    enddocument





    share|improve this answer


















    • 3




      +1, again excellent work.
      – Sebastiano
      Sep 1 at 1:40










    • Excellent, thanks!
      – FlorianL
      Sep 1 at 19:41














    up vote
    37
    down vote



    accepted










    Here is a proposal that makes the nucleus look more like a compact ball. It works by building up circular rings starting from the outside in. By adjusting the number of protons/neutrons in each ring and its distance from the center, you can create a ball effect.



    enter image description here



    documentclassstandalone
    usepackagetikz
    usepackage[version=4]mhchem
    begindocument
    begintikzpicture
    path (-2,-2) rectangle (2,2);
    pgfmathdeclarerandomlistcolorredwhite
    pgfmathsetseed1
    foreach A/R in 25/1,12/0.9,15/0.8,20/0.7,12/0.5,7/0.3,1/0
    pgfmathsetmacroS360/A
    foreach B in 0,S,...,360
    pgfmathrandomitemCcolor
    shade[ball color=C] (B+A:R) circle (5pt);


    node at (-1,1.3) ce^226_88Ra;
    endtikzpicture
    enddocument





    share|improve this answer


















    • 3




      +1, again excellent work.
      – Sebastiano
      Sep 1 at 1:40










    • Excellent, thanks!
      – FlorianL
      Sep 1 at 19:41












    up vote
    37
    down vote



    accepted







    up vote
    37
    down vote



    accepted






    Here is a proposal that makes the nucleus look more like a compact ball. It works by building up circular rings starting from the outside in. By adjusting the number of protons/neutrons in each ring and its distance from the center, you can create a ball effect.



    enter image description here



    documentclassstandalone
    usepackagetikz
    usepackage[version=4]mhchem
    begindocument
    begintikzpicture
    path (-2,-2) rectangle (2,2);
    pgfmathdeclarerandomlistcolorredwhite
    pgfmathsetseed1
    foreach A/R in 25/1,12/0.9,15/0.8,20/0.7,12/0.5,7/0.3,1/0
    pgfmathsetmacroS360/A
    foreach B in 0,S,...,360
    pgfmathrandomitemCcolor
    shade[ball color=C] (B+A:R) circle (5pt);


    node at (-1,1.3) ce^226_88Ra;
    endtikzpicture
    enddocument





    share|improve this answer














    Here is a proposal that makes the nucleus look more like a compact ball. It works by building up circular rings starting from the outside in. By adjusting the number of protons/neutrons in each ring and its distance from the center, you can create a ball effect.



    enter image description here



    documentclassstandalone
    usepackagetikz
    usepackage[version=4]mhchem
    begindocument
    begintikzpicture
    path (-2,-2) rectangle (2,2);
    pgfmathdeclarerandomlistcolorredwhite
    pgfmathsetseed1
    foreach A/R in 25/1,12/0.9,15/0.8,20/0.7,12/0.5,7/0.3,1/0
    pgfmathsetmacroS360/A
    foreach B in 0,S,...,360
    pgfmathrandomitemCcolor
    shade[ball color=C] (B+A:R) circle (5pt);


    node at (-1,1.3) ce^226_88Ra;
    endtikzpicture
    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 31 at 22:27

























    answered Aug 31 at 20:12









    Milo

    5,53321345




    5,53321345







    • 3




      +1, again excellent work.
      – Sebastiano
      Sep 1 at 1:40










    • Excellent, thanks!
      – FlorianL
      Sep 1 at 19:41












    • 3




      +1, again excellent work.
      – Sebastiano
      Sep 1 at 1:40










    • Excellent, thanks!
      – FlorianL
      Sep 1 at 19:41







    3




    3




    +1, again excellent work.
    – Sebastiano
    Sep 1 at 1:40




    +1, again excellent work.
    – Sebastiano
    Sep 1 at 1:40












    Excellent, thanks!
    – FlorianL
    Sep 1 at 19:41




    Excellent, thanks!
    – FlorianL
    Sep 1 at 19:41










    up vote
    13
    down vote













    Based on your code, I first draw protons/neutrons following a circular pattern three times, at radius 1, 0.5 and 0.2. I also draw random protons/neutrons in between.



    documentclassstandalone
    usepackagetikz

    begindocument
    begintikzpicture
    path (-2,-2) rectangle (2,2);
    pgfmathdeclarerandomlistcolorredwhite

    foreach a in 0,10,...,360
    pgfmathrandomitemccolor
    shade[ball color=c] (a:1) circle (5pt);


    foreach a in 0,20,...,360
    pgfmathrandomitemccolor
    shade[ball color=c] (a:0.5) circle (5pt);


    foreach a in 1,...,350
    pgfmathsetmacrorrnd
    pgfmathsetmacroarandom(0,360)
    pgfmathrandomitemccolor
    shade[ball color=c] (a:r) circle (5pt);


    foreach a in 0,60,...,360
    pgfmathrandomitemccolor
    shade[ball color=c] (a:0.2) circle (5pt);

    endtikzpicture
    enddocument


    The results is:



    Screenshot






    share|improve this answer


























      up vote
      13
      down vote













      Based on your code, I first draw protons/neutrons following a circular pattern three times, at radius 1, 0.5 and 0.2. I also draw random protons/neutrons in between.



      documentclassstandalone
      usepackagetikz

      begindocument
      begintikzpicture
      path (-2,-2) rectangle (2,2);
      pgfmathdeclarerandomlistcolorredwhite

      foreach a in 0,10,...,360
      pgfmathrandomitemccolor
      shade[ball color=c] (a:1) circle (5pt);


      foreach a in 0,20,...,360
      pgfmathrandomitemccolor
      shade[ball color=c] (a:0.5) circle (5pt);


      foreach a in 1,...,350
      pgfmathsetmacrorrnd
      pgfmathsetmacroarandom(0,360)
      pgfmathrandomitemccolor
      shade[ball color=c] (a:r) circle (5pt);


      foreach a in 0,60,...,360
      pgfmathrandomitemccolor
      shade[ball color=c] (a:0.2) circle (5pt);

      endtikzpicture
      enddocument


      The results is:



      Screenshot






      share|improve this answer
























        up vote
        13
        down vote










        up vote
        13
        down vote









        Based on your code, I first draw protons/neutrons following a circular pattern three times, at radius 1, 0.5 and 0.2. I also draw random protons/neutrons in between.



        documentclassstandalone
        usepackagetikz

        begindocument
        begintikzpicture
        path (-2,-2) rectangle (2,2);
        pgfmathdeclarerandomlistcolorredwhite

        foreach a in 0,10,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:1) circle (5pt);


        foreach a in 0,20,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:0.5) circle (5pt);


        foreach a in 1,...,350
        pgfmathsetmacrorrnd
        pgfmathsetmacroarandom(0,360)
        pgfmathrandomitemccolor
        shade[ball color=c] (a:r) circle (5pt);


        foreach a in 0,60,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:0.2) circle (5pt);

        endtikzpicture
        enddocument


        The results is:



        Screenshot






        share|improve this answer














        Based on your code, I first draw protons/neutrons following a circular pattern three times, at radius 1, 0.5 and 0.2. I also draw random protons/neutrons in between.



        documentclassstandalone
        usepackagetikz

        begindocument
        begintikzpicture
        path (-2,-2) rectangle (2,2);
        pgfmathdeclarerandomlistcolorredwhite

        foreach a in 0,10,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:1) circle (5pt);


        foreach a in 0,20,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:0.5) circle (5pt);


        foreach a in 1,...,350
        pgfmathsetmacrorrnd
        pgfmathsetmacroarandom(0,360)
        pgfmathrandomitemccolor
        shade[ball color=c] (a:r) circle (5pt);


        foreach a in 0,60,...,360
        pgfmathrandomitemccolor
        shade[ball color=c] (a:0.2) circle (5pt);

        endtikzpicture
        enddocument


        The results is:



        Screenshot







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 1 at 6:30









        current_user

        2,514428




        2,514428










        answered Aug 31 at 19:29









        Ignacio Correa

        583111




        583111




















            up vote
            7
            down vote













            Here is another version in which the spheres are put on the root lattice of A_3 and allowed to wiggle a bit. More explanations can be found here.



            documentclass[tikz,border=3.14mm]standalone
            usepackagetikz-3dplot
            usetikzlibrary3d
            tikzsetdeclare function=posx(x,y,z)=x-y/2;
            posy(x,y,z)=y/sqrt(2);
            posz(x,y,z)=-y/2+z;

            newsaveboxProton
            newsaveboxNeutron
            sboxProtontikzshade[ball color=red] circle(0.85/sqrt(2));
            sboxNeutrontikzshade[ball color=gray!20] circle(0.85/sqrt(2));
            begindocument
            xdefLst-1, 0, 2, -2, -1, 1,
            0, 0, 2, -1, -1, 1,
            -2, -2, 0, -1, 1, 2,
            -2, 0, 1, 1, 0, 2, 0, -1, 1,
            -1, -2, 0, -2, -3, -1,
            0, 1, 2, -1, 0, 1,
            -2, -1, 0, 1, -1, 1,
            0, -2, 0, -1, -3, -1,
            1, 1, 2, 0, 0, 1, -1, -1, 0,
            -2, -2, -1, 0, 2, 2,
            -1, 1, 1, 2, 1, 2, -2, 0, 0,
            1, 0, 1, 0, -1, 0,
            -1, -2, -1, -2, -3, -2,
            1, 2, 2, 0, 1, 1, -1, 0, 0,
            2, 0, 1, -2, -1, -1,
            1, -1, 0, 0, -2, -1,
            -1, -3, -2, 2, 2, 2,
            1, 1, 1, 0, 0, 0,
            -1, -1, -1, -2, -2, -2,
            1, 3, 2, 0, 2, 1, -1, 1, 0,
            2, 1, 1, -2, 0, -1, 1, 0, 0,
            0, -1, -1, -1, -2, -2,
            2, 3, 2, 1, 2, 1, 0, 1, 0,
            -1, 0, -1, 2, 0, 0,
            -2, -1, -2, 1, -1, -1,
            0, -2, -2, 2, 2, 1, 1, 1, 0,
            0, 0, -1, -1, -1, -2,
            1, 3, 1, 0, 2, 0, -1, 1, -1,
            2, 1, 0, 1, 0, -1,
            0, -1, -2, 2, 3, 1, 1, 2, 0,
            0, 1, -1, -1, 0, -2,
            2, 0, -1, 1, -1, -2,
            2, 2, 0, 1, 1, -1, 0, 0, -2,
            2, 1, -1, 1, 0, -2
            tdplotsetmaincoords-90+109.471-90+70
            foreach X in 1,...,10
            begintikzpicture
            path[use as bounding box] (-3.5,-3.5) rectangle (3.5,3.5);
            draw (0,0) circle (1); % /sqrt(2)
            beginscope[tdplot_main_coords]
            draw[-latex] (0,0,0) coordinate (O) -- (1,0,0) node[right]$alpha_1$;
            draw[-latex] (O) -- (-1/2,1/sqrt(2),-1/2) node[right]$alpha_2$;
            draw[-latex] (O) -- (0,0,1) node[right]$alpha_3$;
            draw[red,-latex] (O) -- (1/2,1/sqrt(2),1/2) node[right]$-theta$;
            foreach Z in Lst
            pgfmathsetmacromyxZ[0]
            pgfmathsetmacromyyZ[1]
            pgfmathsetmacromyzZ[2]
            pgfmathsetmacromydeltax0.1*(rnd-0.5)
            pgfmathsetmacromydeltay0.1*(rnd-0.5)
            pgfmathsetmacromydeltaz0.1*(rnd-0.5)
            pgfmathtruncatemacromycolint(2*rnd)
            ifnummycol=1
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxNeutron;
            else
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxProton;
            fi
            endscope
            endtikzpicture
            enddocument


            enter image description here



            Just for fun: more nuclei. And no, it does not look like sphere, but like a set of sphere which are packed with maximum density. This is of course not the same as demanding that the nuclei should fill out a sphere. The latter might translate in the requirement that the sum of distances gets minimized or something like that, which obviously is not the same requirement as maximal packing. I do not know if there is a simple algorithm that minimizes the sum of distances while making sure the spheres do not overlap.



            enter image description here






            share|improve this answer






















            • +1, but somehow this looks not exactly spherical…
              – TeXnician
              Sep 1 at 15:56










            • @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
              – marmot
              Sep 1 at 16:02






            • 1




              Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
              – TeXnician
              Sep 1 at 16:06










            • @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
              – marmot
              Sep 1 at 16:09







            • 1




              @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
              – marmot
              Sep 1 at 20:57














            up vote
            7
            down vote













            Here is another version in which the spheres are put on the root lattice of A_3 and allowed to wiggle a bit. More explanations can be found here.



            documentclass[tikz,border=3.14mm]standalone
            usepackagetikz-3dplot
            usetikzlibrary3d
            tikzsetdeclare function=posx(x,y,z)=x-y/2;
            posy(x,y,z)=y/sqrt(2);
            posz(x,y,z)=-y/2+z;

            newsaveboxProton
            newsaveboxNeutron
            sboxProtontikzshade[ball color=red] circle(0.85/sqrt(2));
            sboxNeutrontikzshade[ball color=gray!20] circle(0.85/sqrt(2));
            begindocument
            xdefLst-1, 0, 2, -2, -1, 1,
            0, 0, 2, -1, -1, 1,
            -2, -2, 0, -1, 1, 2,
            -2, 0, 1, 1, 0, 2, 0, -1, 1,
            -1, -2, 0, -2, -3, -1,
            0, 1, 2, -1, 0, 1,
            -2, -1, 0, 1, -1, 1,
            0, -2, 0, -1, -3, -1,
            1, 1, 2, 0, 0, 1, -1, -1, 0,
            -2, -2, -1, 0, 2, 2,
            -1, 1, 1, 2, 1, 2, -2, 0, 0,
            1, 0, 1, 0, -1, 0,
            -1, -2, -1, -2, -3, -2,
            1, 2, 2, 0, 1, 1, -1, 0, 0,
            2, 0, 1, -2, -1, -1,
            1, -1, 0, 0, -2, -1,
            -1, -3, -2, 2, 2, 2,
            1, 1, 1, 0, 0, 0,
            -1, -1, -1, -2, -2, -2,
            1, 3, 2, 0, 2, 1, -1, 1, 0,
            2, 1, 1, -2, 0, -1, 1, 0, 0,
            0, -1, -1, -1, -2, -2,
            2, 3, 2, 1, 2, 1, 0, 1, 0,
            -1, 0, -1, 2, 0, 0,
            -2, -1, -2, 1, -1, -1,
            0, -2, -2, 2, 2, 1, 1, 1, 0,
            0, 0, -1, -1, -1, -2,
            1, 3, 1, 0, 2, 0, -1, 1, -1,
            2, 1, 0, 1, 0, -1,
            0, -1, -2, 2, 3, 1, 1, 2, 0,
            0, 1, -1, -1, 0, -2,
            2, 0, -1, 1, -1, -2,
            2, 2, 0, 1, 1, -1, 0, 0, -2,
            2, 1, -1, 1, 0, -2
            tdplotsetmaincoords-90+109.471-90+70
            foreach X in 1,...,10
            begintikzpicture
            path[use as bounding box] (-3.5,-3.5) rectangle (3.5,3.5);
            draw (0,0) circle (1); % /sqrt(2)
            beginscope[tdplot_main_coords]
            draw[-latex] (0,0,0) coordinate (O) -- (1,0,0) node[right]$alpha_1$;
            draw[-latex] (O) -- (-1/2,1/sqrt(2),-1/2) node[right]$alpha_2$;
            draw[-latex] (O) -- (0,0,1) node[right]$alpha_3$;
            draw[red,-latex] (O) -- (1/2,1/sqrt(2),1/2) node[right]$-theta$;
            foreach Z in Lst
            pgfmathsetmacromyxZ[0]
            pgfmathsetmacromyyZ[1]
            pgfmathsetmacromyzZ[2]
            pgfmathsetmacromydeltax0.1*(rnd-0.5)
            pgfmathsetmacromydeltay0.1*(rnd-0.5)
            pgfmathsetmacromydeltaz0.1*(rnd-0.5)
            pgfmathtruncatemacromycolint(2*rnd)
            ifnummycol=1
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxNeutron;
            else
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxProton;
            fi
            endscope
            endtikzpicture
            enddocument


            enter image description here



            Just for fun: more nuclei. And no, it does not look like sphere, but like a set of sphere which are packed with maximum density. This is of course not the same as demanding that the nuclei should fill out a sphere. The latter might translate in the requirement that the sum of distances gets minimized or something like that, which obviously is not the same requirement as maximal packing. I do not know if there is a simple algorithm that minimizes the sum of distances while making sure the spheres do not overlap.



            enter image description here






            share|improve this answer






















            • +1, but somehow this looks not exactly spherical…
              – TeXnician
              Sep 1 at 15:56










            • @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
              – marmot
              Sep 1 at 16:02






            • 1




              Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
              – TeXnician
              Sep 1 at 16:06










            • @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
              – marmot
              Sep 1 at 16:09







            • 1




              @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
              – marmot
              Sep 1 at 20:57












            up vote
            7
            down vote










            up vote
            7
            down vote









            Here is another version in which the spheres are put on the root lattice of A_3 and allowed to wiggle a bit. More explanations can be found here.



            documentclass[tikz,border=3.14mm]standalone
            usepackagetikz-3dplot
            usetikzlibrary3d
            tikzsetdeclare function=posx(x,y,z)=x-y/2;
            posy(x,y,z)=y/sqrt(2);
            posz(x,y,z)=-y/2+z;

            newsaveboxProton
            newsaveboxNeutron
            sboxProtontikzshade[ball color=red] circle(0.85/sqrt(2));
            sboxNeutrontikzshade[ball color=gray!20] circle(0.85/sqrt(2));
            begindocument
            xdefLst-1, 0, 2, -2, -1, 1,
            0, 0, 2, -1, -1, 1,
            -2, -2, 0, -1, 1, 2,
            -2, 0, 1, 1, 0, 2, 0, -1, 1,
            -1, -2, 0, -2, -3, -1,
            0, 1, 2, -1, 0, 1,
            -2, -1, 0, 1, -1, 1,
            0, -2, 0, -1, -3, -1,
            1, 1, 2, 0, 0, 1, -1, -1, 0,
            -2, -2, -1, 0, 2, 2,
            -1, 1, 1, 2, 1, 2, -2, 0, 0,
            1, 0, 1, 0, -1, 0,
            -1, -2, -1, -2, -3, -2,
            1, 2, 2, 0, 1, 1, -1, 0, 0,
            2, 0, 1, -2, -1, -1,
            1, -1, 0, 0, -2, -1,
            -1, -3, -2, 2, 2, 2,
            1, 1, 1, 0, 0, 0,
            -1, -1, -1, -2, -2, -2,
            1, 3, 2, 0, 2, 1, -1, 1, 0,
            2, 1, 1, -2, 0, -1, 1, 0, 0,
            0, -1, -1, -1, -2, -2,
            2, 3, 2, 1, 2, 1, 0, 1, 0,
            -1, 0, -1, 2, 0, 0,
            -2, -1, -2, 1, -1, -1,
            0, -2, -2, 2, 2, 1, 1, 1, 0,
            0, 0, -1, -1, -1, -2,
            1, 3, 1, 0, 2, 0, -1, 1, -1,
            2, 1, 0, 1, 0, -1,
            0, -1, -2, 2, 3, 1, 1, 2, 0,
            0, 1, -1, -1, 0, -2,
            2, 0, -1, 1, -1, -2,
            2, 2, 0, 1, 1, -1, 0, 0, -2,
            2, 1, -1, 1, 0, -2
            tdplotsetmaincoords-90+109.471-90+70
            foreach X in 1,...,10
            begintikzpicture
            path[use as bounding box] (-3.5,-3.5) rectangle (3.5,3.5);
            draw (0,0) circle (1); % /sqrt(2)
            beginscope[tdplot_main_coords]
            draw[-latex] (0,0,0) coordinate (O) -- (1,0,0) node[right]$alpha_1$;
            draw[-latex] (O) -- (-1/2,1/sqrt(2),-1/2) node[right]$alpha_2$;
            draw[-latex] (O) -- (0,0,1) node[right]$alpha_3$;
            draw[red,-latex] (O) -- (1/2,1/sqrt(2),1/2) node[right]$-theta$;
            foreach Z in Lst
            pgfmathsetmacromyxZ[0]
            pgfmathsetmacromyyZ[1]
            pgfmathsetmacromyzZ[2]
            pgfmathsetmacromydeltax0.1*(rnd-0.5)
            pgfmathsetmacromydeltay0.1*(rnd-0.5)
            pgfmathsetmacromydeltaz0.1*(rnd-0.5)
            pgfmathtruncatemacromycolint(2*rnd)
            ifnummycol=1
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxNeutron;
            else
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxProton;
            fi
            endscope
            endtikzpicture
            enddocument


            enter image description here



            Just for fun: more nuclei. And no, it does not look like sphere, but like a set of sphere which are packed with maximum density. This is of course not the same as demanding that the nuclei should fill out a sphere. The latter might translate in the requirement that the sum of distances gets minimized or something like that, which obviously is not the same requirement as maximal packing. I do not know if there is a simple algorithm that minimizes the sum of distances while making sure the spheres do not overlap.



            enter image description here






            share|improve this answer














            Here is another version in which the spheres are put on the root lattice of A_3 and allowed to wiggle a bit. More explanations can be found here.



            documentclass[tikz,border=3.14mm]standalone
            usepackagetikz-3dplot
            usetikzlibrary3d
            tikzsetdeclare function=posx(x,y,z)=x-y/2;
            posy(x,y,z)=y/sqrt(2);
            posz(x,y,z)=-y/2+z;

            newsaveboxProton
            newsaveboxNeutron
            sboxProtontikzshade[ball color=red] circle(0.85/sqrt(2));
            sboxNeutrontikzshade[ball color=gray!20] circle(0.85/sqrt(2));
            begindocument
            xdefLst-1, 0, 2, -2, -1, 1,
            0, 0, 2, -1, -1, 1,
            -2, -2, 0, -1, 1, 2,
            -2, 0, 1, 1, 0, 2, 0, -1, 1,
            -1, -2, 0, -2, -3, -1,
            0, 1, 2, -1, 0, 1,
            -2, -1, 0, 1, -1, 1,
            0, -2, 0, -1, -3, -1,
            1, 1, 2, 0, 0, 1, -1, -1, 0,
            -2, -2, -1, 0, 2, 2,
            -1, 1, 1, 2, 1, 2, -2, 0, 0,
            1, 0, 1, 0, -1, 0,
            -1, -2, -1, -2, -3, -2,
            1, 2, 2, 0, 1, 1, -1, 0, 0,
            2, 0, 1, -2, -1, -1,
            1, -1, 0, 0, -2, -1,
            -1, -3, -2, 2, 2, 2,
            1, 1, 1, 0, 0, 0,
            -1, -1, -1, -2, -2, -2,
            1, 3, 2, 0, 2, 1, -1, 1, 0,
            2, 1, 1, -2, 0, -1, 1, 0, 0,
            0, -1, -1, -1, -2, -2,
            2, 3, 2, 1, 2, 1, 0, 1, 0,
            -1, 0, -1, 2, 0, 0,
            -2, -1, -2, 1, -1, -1,
            0, -2, -2, 2, 2, 1, 1, 1, 0,
            0, 0, -1, -1, -1, -2,
            1, 3, 1, 0, 2, 0, -1, 1, -1,
            2, 1, 0, 1, 0, -1,
            0, -1, -2, 2, 3, 1, 1, 2, 0,
            0, 1, -1, -1, 0, -2,
            2, 0, -1, 1, -1, -2,
            2, 2, 0, 1, 1, -1, 0, 0, -2,
            2, 1, -1, 1, 0, -2
            tdplotsetmaincoords-90+109.471-90+70
            foreach X in 1,...,10
            begintikzpicture
            path[use as bounding box] (-3.5,-3.5) rectangle (3.5,3.5);
            draw (0,0) circle (1); % /sqrt(2)
            beginscope[tdplot_main_coords]
            draw[-latex] (0,0,0) coordinate (O) -- (1,0,0) node[right]$alpha_1$;
            draw[-latex] (O) -- (-1/2,1/sqrt(2),-1/2) node[right]$alpha_2$;
            draw[-latex] (O) -- (0,0,1) node[right]$alpha_3$;
            draw[red,-latex] (O) -- (1/2,1/sqrt(2),1/2) node[right]$-theta$;
            foreach Z in Lst
            pgfmathsetmacromyxZ[0]
            pgfmathsetmacromyyZ[1]
            pgfmathsetmacromyzZ[2]
            pgfmathsetmacromydeltax0.1*(rnd-0.5)
            pgfmathsetmacromydeltay0.1*(rnd-0.5)
            pgfmathsetmacromydeltaz0.1*(rnd-0.5)
            pgfmathtruncatemacromycolint(2*rnd)
            ifnummycol=1
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxNeutron;
            else
            node at (posx(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posy(myx+mydeltax,myy+mydeltay,myz+mydeltaz),
            posz(myx+mydeltax,myy+mydeltay,myz+mydeltaz)) useboxProton;
            fi
            endscope
            endtikzpicture
            enddocument


            enter image description here



            Just for fun: more nuclei. And no, it does not look like sphere, but like a set of sphere which are packed with maximum density. This is of course not the same as demanding that the nuclei should fill out a sphere. The latter might translate in the requirement that the sum of distances gets minimized or something like that, which obviously is not the same requirement as maximal packing. I do not know if there is a simple algorithm that minimizes the sum of distances while making sure the spheres do not overlap.



            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Sep 1 at 16:45

























            answered Sep 1 at 15:41









            marmot

            56.2k461122




            56.2k461122











            • +1, but somehow this looks not exactly spherical…
              – TeXnician
              Sep 1 at 15:56










            • @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
              – marmot
              Sep 1 at 16:02






            • 1




              Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
              – TeXnician
              Sep 1 at 16:06










            • @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
              – marmot
              Sep 1 at 16:09







            • 1




              @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
              – marmot
              Sep 1 at 20:57
















            • +1, but somehow this looks not exactly spherical…
              – TeXnician
              Sep 1 at 15:56










            • @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
              – marmot
              Sep 1 at 16:02






            • 1




              Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
              – TeXnician
              Sep 1 at 16:06










            • @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
              – marmot
              Sep 1 at 16:09







            • 1




              @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
              – marmot
              Sep 1 at 20:57















            +1, but somehow this looks not exactly spherical…
            – TeXnician
            Sep 1 at 15:56




            +1, but somehow this looks not exactly spherical…
            – TeXnician
            Sep 1 at 15:56












            @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
            – marmot
            Sep 1 at 16:02




            @TeXnician It might be that I did something wrong but they are not supposed to look spherical. More precisely, they will approach a sphere in the limit of infinitely many spheres. Just do a 2D example and pack two circles. Does that look like a bigger circle? Definitely not. Same for any finite amount of circles. You will arrange them on a hexagonal lattice and put them as close as possible to a center, but the emerging shape is never a precise circle as long as you have a finite number of circles. This here is the 3D version of that (I hope).
            – marmot
            Sep 1 at 16:02




            1




            1




            Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
            – TeXnician
            Sep 1 at 16:06




            Yes, I understand the approach which is interesting, I just understood the OP to reproduce a "spherical look", but who knows how realistic either of these representations is :)
            – TeXnician
            Sep 1 at 16:06












            @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
            – marmot
            Sep 1 at 16:09





            @TeXnician Well, in reality nuclei are not spheres, and the interactions between them cannot be described by a spherical potential, rather there are the dominant strong interactions plus a bit of electromagnetic interactions. This lattice packing allows you to partly understand why there are these magical numbers. And I think that this approach comes close to the OP's version if I increase the number of spheres. Just fill a hexagonal lattice with a huge number of circles around a center, and it will approach a circle. If the number of circles is smaller, it will have "edges".
            – marmot
            Sep 1 at 16:09





            1




            1




            @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
            – marmot
            Sep 1 at 20:57




            @FlorianL Well, you could define your own version: tikzsetdeclare function=Veclen(x,y,z)=sqrt(x*x+y*y+z*z);. However, I am not sure if my result is more physical. Apart from the fact that nuclei are not spheres, my procedure produces something that has only discrete rotational symmetries, but I don't see a reason why a nucleus should have some preferred axes. I think all of these are just cartoons, and among the proposals so far, IMHO Milo's nice answer is the winner. It is nicer and TeX only.
            – marmot
            Sep 1 at 20:57

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448733%2fhow-to-create-nice-looking-nuclei-in-tikz%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery