How can find the 2D Voronoi cell area distribution?How can Mathematica be used to detect an area surrounded...

What is an efficient way to digitize a family photo collection?

Coworker asking me to not bring cakes due to self control issue. What should I do?

Count repetitions of an array

Given a total recursive function, can you always compute its fixed-point?

Calculating the strength of an ionic bond that contains poly-atomic ions

Is layered encryption more secure than long passwords?

Identical projects by students at two different colleges: still plagiarism?

Promise.all returning empty objects

What could cause an entire planet of humans to become aphasic?

Was there a pre-determined arrangement for the division of Germany in case it surrendered before any Soviet forces entered its territory?

Does copper wire need to say it's copper?

Why do neural networks need so many examples to perform?

Why does a single AND gate need 60 transistors?

Is Screenshot Time-tracking Common?

Would water spill from a bowl in a Bag of Holding?

How unreachable are Jupiter's moons from Mars with the technology developed for going to Mars?

How to deal with an underperforming subordinate?

How do I avoid the "chosen hero" feeling?

Even as admin, I cannot edit DefaultFonts.plist for Notes.app. What am I doing wrong?

"I showed the monkey himself in the mirror". Why is this sentence grammatical?

Buying a "Used" Router

How to draw a node with two options using TikZ graphs in LaTeX

Is there a way to pause a running process on Linux systems and resume later?

How can find the 2D Voronoi cell area distribution?



How can find the 2D Voronoi cell area distribution?


How can Mathematica be used to detect an area surrounded by the most lines?Find area of polygon on a sphere from a set of latitude-longitude pointsMeshRegion: How to take out a subregionColor code Voronoi cell areas depending on number of verticesRemoving cells from Voronoi mesh if they exceed a certain area or circumferenceHyperbolic Voronoi diagram for the Poincaré model, using RegionPlotHow to find the Convex Hullcolor voronoi cell based on areaHow can I efficiently generate regions from long lists of conditions?How to get size of each polygon of a Voronoi diagram using Shoelace formula?













2












$begingroup$


I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?










share|improve this question









New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    If you were to provide your old instructions, we might be able to fix them.
    $endgroup$
    – C. E.
    1 hour ago
















2












$begingroup$


I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?










share|improve this question









New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    If you were to provide your old instructions, we might be able to fix them.
    $endgroup$
    – C. E.
    1 hour ago














2












2








2





$begingroup$


I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?










share|improve this question









New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I need to find the area distribution function of the 2D Voronoi cells in Mathematica version 11 and later. My old instructions for Mathematica 9 don't work anymore. How can I do it?







computational-geometry






share|improve this question









New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









C. E.

50.6k397204




50.6k397204






New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









massimomassimo

111




111




New contributor




massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






massimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    $begingroup$
    If you were to provide your old instructions, we might be able to fix them.
    $endgroup$
    – C. E.
    1 hour ago














  • 1




    $begingroup$
    If you were to provide your old instructions, we might be able to fix them.
    $endgroup$
    – C. E.
    1 hour ago








1




1




$begingroup$
If you were to provide your old instructions, we might be able to fix them.
$endgroup$
– C. E.
1 hour ago




$begingroup$
If you were to provide your old instructions, we might be able to fix them.
$endgroup$
– C. E.
1 hour ago










2 Answers
2






active

oldest

votes


















3












$begingroup$

First compute the Voronoi mesh:



pts = RandomReal[{-1, 1}, {25, 2}];
mesh = VoronoiMesh[pts]


Mathematica graphics



Then compute the areas of the mesh primitives (MeshPrimitives yields a polygon for each Voronoi region):



areas = Area /@ MeshPrimitives[mesh, 2];
Histogram[areas]


Mathematica graphics






share|improve this answer









$endgroup$









  • 1




    $begingroup$
    We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
    $endgroup$
    – Chip Hurst
    47 mins ago










  • $begingroup$
    This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
    $endgroup$
    – Vitaliy Kaurov
    12 mins ago



















1












$begingroup$

I think it is a GammaDistribution and we can show it, also see reference:



http://www.scipress.org/journals/forma/pdf/1804/18040221.pdf



@C.E. answer is a good start, but without careful consideration might yield wrong stats. To gather good statistics let's build a "large", 5000 cells VoronoiMesh within a unit Disk:



pts = RandomPoint[Disk[], 5000];
mesh = VoronoiMesh[pts, Axes -> True]


We see the stats are obviously offset by the presence of "border" cells of much larger area than regular inner cells have.



enter image description here



Let's exclude large cells by selecting only those within original region of random points distribution - unit Disk:



vor=MeshPrimitives[mesh,2];
vor//Length



5000




vorInner=Select[vor,RegionWithin[Disk[],#]&];
vorInner//Length



4782




We got fewer elements of course and they all are nice regular cells:



Graphics[{FaceForm[None], EdgeForm[Gray], vorInner}]


enter image description here



Now you can see that there is a minimum of distribution at zero area. Close to zero-area cells of course are not present much with the finite number of points per region (or finite density). So there is some prevalent finite mean area there.



areas = Area /@ vorInner;
hist = Histogram[areas, Automatic, "PDF", PlotTheme -> "Detailed"]


enter image description here



You can find a very close simple analytic distribution:



dis=FindDistribution[areas]



GammaDistribution[3.3458431368450587,0.00018456010158014188]




which matches very nicely the empirical histogram:



Show[hist, Plot[PDF[dis, x], {x, 0, .0015}]]


enter image description here



And now it is easy to find thing like:



{Mean[dis], Variance[dis], Kurtosis[dis]}



{0.0006175091492073445, 1.1396755130437449*^-7, 4.793269963533813`}




Probability[x > .0005, x [Distributed] dis]



0.5740480899719699`







share|improve this answer











$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "387"
    };
    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    massimo is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192129%2fhow-can-find-the-2d-voronoi-cell-area-distribution%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3












    $begingroup$

    First compute the Voronoi mesh:



    pts = RandomReal[{-1, 1}, {25, 2}];
    mesh = VoronoiMesh[pts]


    Mathematica graphics



    Then compute the areas of the mesh primitives (MeshPrimitives yields a polygon for each Voronoi region):



    areas = Area /@ MeshPrimitives[mesh, 2];
    Histogram[areas]


    Mathematica graphics






    share|improve this answer









    $endgroup$









    • 1




      $begingroup$
      We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
      $endgroup$
      – Chip Hurst
      47 mins ago










    • $begingroup$
      This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
      $endgroup$
      – Vitaliy Kaurov
      12 mins ago
















    3












    $begingroup$

    First compute the Voronoi mesh:



    pts = RandomReal[{-1, 1}, {25, 2}];
    mesh = VoronoiMesh[pts]


    Mathematica graphics



    Then compute the areas of the mesh primitives (MeshPrimitives yields a polygon for each Voronoi region):



    areas = Area /@ MeshPrimitives[mesh, 2];
    Histogram[areas]


    Mathematica graphics






    share|improve this answer









    $endgroup$









    • 1




      $begingroup$
      We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
      $endgroup$
      – Chip Hurst
      47 mins ago










    • $begingroup$
      This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
      $endgroup$
      – Vitaliy Kaurov
      12 mins ago














    3












    3








    3





    $begingroup$

    First compute the Voronoi mesh:



    pts = RandomReal[{-1, 1}, {25, 2}];
    mesh = VoronoiMesh[pts]


    Mathematica graphics



    Then compute the areas of the mesh primitives (MeshPrimitives yields a polygon for each Voronoi region):



    areas = Area /@ MeshPrimitives[mesh, 2];
    Histogram[areas]


    Mathematica graphics






    share|improve this answer









    $endgroup$



    First compute the Voronoi mesh:



    pts = RandomReal[{-1, 1}, {25, 2}];
    mesh = VoronoiMesh[pts]


    Mathematica graphics



    Then compute the areas of the mesh primitives (MeshPrimitives yields a polygon for each Voronoi region):



    areas = Area /@ MeshPrimitives[mesh, 2];
    Histogram[areas]


    Mathematica graphics







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 1 hour ago









    C. E.C. E.

    50.6k397204




    50.6k397204








    • 1




      $begingroup$
      We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
      $endgroup$
      – Chip Hurst
      47 mins ago










    • $begingroup$
      This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
      $endgroup$
      – Vitaliy Kaurov
      12 mins ago














    • 1




      $begingroup$
      We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
      $endgroup$
      – Chip Hurst
      47 mins ago










    • $begingroup$
      This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
      $endgroup$
      – Vitaliy Kaurov
      12 mins ago








    1




    1




    $begingroup$
    We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
    $endgroup$
    – Chip Hurst
    47 mins ago




    $begingroup$
    We can also query for the cell areas via PropertyValue[{mesh, 2}, MeshCellMeasure].
    $endgroup$
    – Chip Hurst
    47 mins ago












    $begingroup$
    This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
    $endgroup$
    – Vitaliy Kaurov
    12 mins ago




    $begingroup$
    This could give wrong stats, C.E. and @ChipHurst. I posted a bit different version.
    $endgroup$
    – Vitaliy Kaurov
    12 mins ago











    1












    $begingroup$

    I think it is a GammaDistribution and we can show it, also see reference:



    http://www.scipress.org/journals/forma/pdf/1804/18040221.pdf



    @C.E. answer is a good start, but without careful consideration might yield wrong stats. To gather good statistics let's build a "large", 5000 cells VoronoiMesh within a unit Disk:



    pts = RandomPoint[Disk[], 5000];
    mesh = VoronoiMesh[pts, Axes -> True]


    We see the stats are obviously offset by the presence of "border" cells of much larger area than regular inner cells have.



    enter image description here



    Let's exclude large cells by selecting only those within original region of random points distribution - unit Disk:



    vor=MeshPrimitives[mesh,2];
    vor//Length



    5000




    vorInner=Select[vor,RegionWithin[Disk[],#]&];
    vorInner//Length



    4782




    We got fewer elements of course and they all are nice regular cells:



    Graphics[{FaceForm[None], EdgeForm[Gray], vorInner}]


    enter image description here



    Now you can see that there is a minimum of distribution at zero area. Close to zero-area cells of course are not present much with the finite number of points per region (or finite density). So there is some prevalent finite mean area there.



    areas = Area /@ vorInner;
    hist = Histogram[areas, Automatic, "PDF", PlotTheme -> "Detailed"]


    enter image description here



    You can find a very close simple analytic distribution:



    dis=FindDistribution[areas]



    GammaDistribution[3.3458431368450587,0.00018456010158014188]




    which matches very nicely the empirical histogram:



    Show[hist, Plot[PDF[dis, x], {x, 0, .0015}]]


    enter image description here



    And now it is easy to find thing like:



    {Mean[dis], Variance[dis], Kurtosis[dis]}



    {0.0006175091492073445, 1.1396755130437449*^-7, 4.793269963533813`}




    Probability[x > .0005, x [Distributed] dis]



    0.5740480899719699`







    share|improve this answer











    $endgroup$


















      1












      $begingroup$

      I think it is a GammaDistribution and we can show it, also see reference:



      http://www.scipress.org/journals/forma/pdf/1804/18040221.pdf



      @C.E. answer is a good start, but without careful consideration might yield wrong stats. To gather good statistics let's build a "large", 5000 cells VoronoiMesh within a unit Disk:



      pts = RandomPoint[Disk[], 5000];
      mesh = VoronoiMesh[pts, Axes -> True]


      We see the stats are obviously offset by the presence of "border" cells of much larger area than regular inner cells have.



      enter image description here



      Let's exclude large cells by selecting only those within original region of random points distribution - unit Disk:



      vor=MeshPrimitives[mesh,2];
      vor//Length



      5000




      vorInner=Select[vor,RegionWithin[Disk[],#]&];
      vorInner//Length



      4782




      We got fewer elements of course and they all are nice regular cells:



      Graphics[{FaceForm[None], EdgeForm[Gray], vorInner}]


      enter image description here



      Now you can see that there is a minimum of distribution at zero area. Close to zero-area cells of course are not present much with the finite number of points per region (or finite density). So there is some prevalent finite mean area there.



      areas = Area /@ vorInner;
      hist = Histogram[areas, Automatic, "PDF", PlotTheme -> "Detailed"]


      enter image description here



      You can find a very close simple analytic distribution:



      dis=FindDistribution[areas]



      GammaDistribution[3.3458431368450587,0.00018456010158014188]




      which matches very nicely the empirical histogram:



      Show[hist, Plot[PDF[dis, x], {x, 0, .0015}]]


      enter image description here



      And now it is easy to find thing like:



      {Mean[dis], Variance[dis], Kurtosis[dis]}



      {0.0006175091492073445, 1.1396755130437449*^-7, 4.793269963533813`}




      Probability[x > .0005, x [Distributed] dis]



      0.5740480899719699`







      share|improve this answer











      $endgroup$
















        1












        1








        1





        $begingroup$

        I think it is a GammaDistribution and we can show it, also see reference:



        http://www.scipress.org/journals/forma/pdf/1804/18040221.pdf



        @C.E. answer is a good start, but without careful consideration might yield wrong stats. To gather good statistics let's build a "large", 5000 cells VoronoiMesh within a unit Disk:



        pts = RandomPoint[Disk[], 5000];
        mesh = VoronoiMesh[pts, Axes -> True]


        We see the stats are obviously offset by the presence of "border" cells of much larger area than regular inner cells have.



        enter image description here



        Let's exclude large cells by selecting only those within original region of random points distribution - unit Disk:



        vor=MeshPrimitives[mesh,2];
        vor//Length



        5000




        vorInner=Select[vor,RegionWithin[Disk[],#]&];
        vorInner//Length



        4782




        We got fewer elements of course and they all are nice regular cells:



        Graphics[{FaceForm[None], EdgeForm[Gray], vorInner}]


        enter image description here



        Now you can see that there is a minimum of distribution at zero area. Close to zero-area cells of course are not present much with the finite number of points per region (or finite density). So there is some prevalent finite mean area there.



        areas = Area /@ vorInner;
        hist = Histogram[areas, Automatic, "PDF", PlotTheme -> "Detailed"]


        enter image description here



        You can find a very close simple analytic distribution:



        dis=FindDistribution[areas]



        GammaDistribution[3.3458431368450587,0.00018456010158014188]




        which matches very nicely the empirical histogram:



        Show[hist, Plot[PDF[dis, x], {x, 0, .0015}]]


        enter image description here



        And now it is easy to find thing like:



        {Mean[dis], Variance[dis], Kurtosis[dis]}



        {0.0006175091492073445, 1.1396755130437449*^-7, 4.793269963533813`}




        Probability[x > .0005, x [Distributed] dis]



        0.5740480899719699`







        share|improve this answer











        $endgroup$



        I think it is a GammaDistribution and we can show it, also see reference:



        http://www.scipress.org/journals/forma/pdf/1804/18040221.pdf



        @C.E. answer is a good start, but without careful consideration might yield wrong stats. To gather good statistics let's build a "large", 5000 cells VoronoiMesh within a unit Disk:



        pts = RandomPoint[Disk[], 5000];
        mesh = VoronoiMesh[pts, Axes -> True]


        We see the stats are obviously offset by the presence of "border" cells of much larger area than regular inner cells have.



        enter image description here



        Let's exclude large cells by selecting only those within original region of random points distribution - unit Disk:



        vor=MeshPrimitives[mesh,2];
        vor//Length



        5000




        vorInner=Select[vor,RegionWithin[Disk[],#]&];
        vorInner//Length



        4782




        We got fewer elements of course and they all are nice regular cells:



        Graphics[{FaceForm[None], EdgeForm[Gray], vorInner}]


        enter image description here



        Now you can see that there is a minimum of distribution at zero area. Close to zero-area cells of course are not present much with the finite number of points per region (or finite density). So there is some prevalent finite mean area there.



        areas = Area /@ vorInner;
        hist = Histogram[areas, Automatic, "PDF", PlotTheme -> "Detailed"]


        enter image description here



        You can find a very close simple analytic distribution:



        dis=FindDistribution[areas]



        GammaDistribution[3.3458431368450587,0.00018456010158014188]




        which matches very nicely the empirical histogram:



        Show[hist, Plot[PDF[dis, x], {x, 0, .0015}]]


        enter image description here



        And now it is easy to find thing like:



        {Mean[dis], Variance[dis], Kurtosis[dis]}



        {0.0006175091492073445, 1.1396755130437449*^-7, 4.793269963533813`}




        Probability[x > .0005, x [Distributed] dis]



        0.5740480899719699`








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 7 mins ago

























        answered 24 mins ago









        Vitaliy KaurovVitaliy Kaurov

        57.3k6161280




        57.3k6161280






















            massimo is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            massimo is a new contributor. Be nice, and check out our Code of Conduct.













            massimo is a new contributor. Be nice, and check out our Code of Conduct.












            massimo is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192129%2fhow-can-find-the-2d-voronoi-cell-area-distribution%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

            Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

            How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...