Calculating list of areas between the curves in an intersection region












4












$begingroup$


I have 2 tables;



table 1:



ctr = {(Exp[Pi*0.5] + 1)/2, 0};
radius = (Exp[Pi*0.5] - 1)/2;
pp = PolarPlot[
Evaluate@Table[Exp[(t + 2*Pi*i/120)*0.5], {i, 1, 120}], {t, -Pi,
Pi}, RegionFunction -> (Norm[{#, #2} - ctr] <= radius &)]
Total[ArcLength /@ Cases[pp, _Line, All]]


spiral



and table 2:



ctr = {(Exp[Pi*0.5] - 1)/2, 0};
radius = (Exp[Pi*0.5] - 1)/2;
pp2 = ParametricPlot[
Evaluate[Table[{t, t (Tan[2 j Pi / 120])}, {j, 1, 60}]], {t, -5, 5},
RegionFunction -> (Norm[{#, #2} - ctr] <= radius &),
PlotRange -> All]
Total[ArcLength /@ Cases[pp2, _Line, All]]


Line



I want to calculate each area between the curves and show them in histogram so I can evaluate maximum and minimum gaps between the tables. I illustrated what I want as below:



gradient



can you show me how?










share|improve this question









$endgroup$

















    4












    $begingroup$


    I have 2 tables;



    table 1:



    ctr = {(Exp[Pi*0.5] + 1)/2, 0};
    radius = (Exp[Pi*0.5] - 1)/2;
    pp = PolarPlot[
    Evaluate@Table[Exp[(t + 2*Pi*i/120)*0.5], {i, 1, 120}], {t, -Pi,
    Pi}, RegionFunction -> (Norm[{#, #2} - ctr] <= radius &)]
    Total[ArcLength /@ Cases[pp, _Line, All]]


    spiral



    and table 2:



    ctr = {(Exp[Pi*0.5] - 1)/2, 0};
    radius = (Exp[Pi*0.5] - 1)/2;
    pp2 = ParametricPlot[
    Evaluate[Table[{t, t (Tan[2 j Pi / 120])}, {j, 1, 60}]], {t, -5, 5},
    RegionFunction -> (Norm[{#, #2} - ctr] <= radius &),
    PlotRange -> All]
    Total[ArcLength /@ Cases[pp2, _Line, All]]


    Line



    I want to calculate each area between the curves and show them in histogram so I can evaluate maximum and minimum gaps between the tables. I illustrated what I want as below:



    gradient



    can you show me how?










    share|improve this question









    $endgroup$















      4












      4








      4





      $begingroup$


      I have 2 tables;



      table 1:



      ctr = {(Exp[Pi*0.5] + 1)/2, 0};
      radius = (Exp[Pi*0.5] - 1)/2;
      pp = PolarPlot[
      Evaluate@Table[Exp[(t + 2*Pi*i/120)*0.5], {i, 1, 120}], {t, -Pi,
      Pi}, RegionFunction -> (Norm[{#, #2} - ctr] <= radius &)]
      Total[ArcLength /@ Cases[pp, _Line, All]]


      spiral



      and table 2:



      ctr = {(Exp[Pi*0.5] - 1)/2, 0};
      radius = (Exp[Pi*0.5] - 1)/2;
      pp2 = ParametricPlot[
      Evaluate[Table[{t, t (Tan[2 j Pi / 120])}, {j, 1, 60}]], {t, -5, 5},
      RegionFunction -> (Norm[{#, #2} - ctr] <= radius &),
      PlotRange -> All]
      Total[ArcLength /@ Cases[pp2, _Line, All]]


      Line



      I want to calculate each area between the curves and show them in histogram so I can evaluate maximum and minimum gaps between the tables. I illustrated what I want as below:



      gradient



      can you show me how?










      share|improve this question









      $endgroup$




      I have 2 tables;



      table 1:



      ctr = {(Exp[Pi*0.5] + 1)/2, 0};
      radius = (Exp[Pi*0.5] - 1)/2;
      pp = PolarPlot[
      Evaluate@Table[Exp[(t + 2*Pi*i/120)*0.5], {i, 1, 120}], {t, -Pi,
      Pi}, RegionFunction -> (Norm[{#, #2} - ctr] <= radius &)]
      Total[ArcLength /@ Cases[pp, _Line, All]]


      spiral



      and table 2:



      ctr = {(Exp[Pi*0.5] - 1)/2, 0};
      radius = (Exp[Pi*0.5] - 1)/2;
      pp2 = ParametricPlot[
      Evaluate[Table[{t, t (Tan[2 j Pi / 120])}, {j, 1, 60}]], {t, -5, 5},
      RegionFunction -> (Norm[{#, #2} - ctr] <= radius &),
      PlotRange -> All]
      Total[ArcLength /@ Cases[pp2, _Line, All]]


      Line



      I want to calculate each area between the curves and show them in histogram so I can evaluate maximum and minimum gaps between the tables. I illustrated what I want as below:



      gradient



      can you show me how?







      regions intersection






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 23 at 12:09









      Alper91Alper91

      1356




      1356






















          1 Answer
          1






          active

          oldest

          votes


















          6












          $begingroup$

          You could define a ParametricRegion , examplary between curves #10 and #11



          reg10 = ParametricRegion[{{Cos[t], Sin[t]} Exp[(t + 2*Pi*ii/120)/2], (Sqrt[#.#] < radius) &[{Cos[t],Sin[t]} Exp[(t + 2*Pi*ii/120)/2] - ctr]}
          , {{t, -Pi, Pi}, {ii, 10, 11}}]
          DiscretizeRegion[reg10]


          enter image description here



          Area[DiscretizeRegion[reg10]]
          (*0.0592725*)


          addendum



          Knowing the plot pp a very fast straightforward solution is possible:
          First get the Line-objects from the plot



          linien = Cases[pp, _Line , Infinity];


          Two neighboring lines form a polygon from which the area can be calculated



          areas=Table[ Area@Polygon[Join[linien[[i]][[1]], Reverse[linien[[i + 1]][[1]]]]], {i,1, Length[linien] - 1}] 
          (*{0.0243947, 0.0281509, 0.0318023, 0.0353948, 0.039143, 0.0430014,
          0.0469289, 0.050997, 0.0551564, 0.0594015, 0.0639209, 0.0684968,
          0.0731468, 0.0780328, 0.0830698, 0.0882845, 0.0936695, 0.0992263,
          0.104955, 0.111007, 0.117283, 0.123424, 0.129694, 0.136315, 0.143126,
          0.150108, 0.157259, 0.164582, 0.172953, 0.1806, 0.187462, 0.195366,
          0.203387, 0.21151, 0.22005, 0.228322, 0.23627, 0.24457, 0.252866,
          0.261078, 0.269163, 0.27711, 0.284845, 0.292302, 0.299405, 0.306072,
          0.312203, 0.317686, 0.322383, 0.326143, 0.329235, 0.330515, 0.329747,
          0.327478, 0.322887, 0.315273, 0.304139, 0.288177, 0.265912, 0.234501,
          0.187173}*)


          That's it! Hope it helps.






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
            $endgroup$
            – Alper91
            Feb 23 at 15:30










          • $begingroup$
            Put it in a Table[...,{i,1,119}]
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 17:57










          • $begingroup$
            @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 19:44










          • $begingroup$
            Thanks. It worked easily.
            $endgroup$
            – Alper91
            Feb 24 at 7:29











          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f192068%2fcalculating-list-of-areas-between-the-curves-in-an-intersection-region%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          6












          $begingroup$

          You could define a ParametricRegion , examplary between curves #10 and #11



          reg10 = ParametricRegion[{{Cos[t], Sin[t]} Exp[(t + 2*Pi*ii/120)/2], (Sqrt[#.#] < radius) &[{Cos[t],Sin[t]} Exp[(t + 2*Pi*ii/120)/2] - ctr]}
          , {{t, -Pi, Pi}, {ii, 10, 11}}]
          DiscretizeRegion[reg10]


          enter image description here



          Area[DiscretizeRegion[reg10]]
          (*0.0592725*)


          addendum



          Knowing the plot pp a very fast straightforward solution is possible:
          First get the Line-objects from the plot



          linien = Cases[pp, _Line , Infinity];


          Two neighboring lines form a polygon from which the area can be calculated



          areas=Table[ Area@Polygon[Join[linien[[i]][[1]], Reverse[linien[[i + 1]][[1]]]]], {i,1, Length[linien] - 1}] 
          (*{0.0243947, 0.0281509, 0.0318023, 0.0353948, 0.039143, 0.0430014,
          0.0469289, 0.050997, 0.0551564, 0.0594015, 0.0639209, 0.0684968,
          0.0731468, 0.0780328, 0.0830698, 0.0882845, 0.0936695, 0.0992263,
          0.104955, 0.111007, 0.117283, 0.123424, 0.129694, 0.136315, 0.143126,
          0.150108, 0.157259, 0.164582, 0.172953, 0.1806, 0.187462, 0.195366,
          0.203387, 0.21151, 0.22005, 0.228322, 0.23627, 0.24457, 0.252866,
          0.261078, 0.269163, 0.27711, 0.284845, 0.292302, 0.299405, 0.306072,
          0.312203, 0.317686, 0.322383, 0.326143, 0.329235, 0.330515, 0.329747,
          0.327478, 0.322887, 0.315273, 0.304139, 0.288177, 0.265912, 0.234501,
          0.187173}*)


          That's it! Hope it helps.






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
            $endgroup$
            – Alper91
            Feb 23 at 15:30










          • $begingroup$
            Put it in a Table[...,{i,1,119}]
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 17:57










          • $begingroup$
            @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 19:44










          • $begingroup$
            Thanks. It worked easily.
            $endgroup$
            – Alper91
            Feb 24 at 7:29
















          6












          $begingroup$

          You could define a ParametricRegion , examplary between curves #10 and #11



          reg10 = ParametricRegion[{{Cos[t], Sin[t]} Exp[(t + 2*Pi*ii/120)/2], (Sqrt[#.#] < radius) &[{Cos[t],Sin[t]} Exp[(t + 2*Pi*ii/120)/2] - ctr]}
          , {{t, -Pi, Pi}, {ii, 10, 11}}]
          DiscretizeRegion[reg10]


          enter image description here



          Area[DiscretizeRegion[reg10]]
          (*0.0592725*)


          addendum



          Knowing the plot pp a very fast straightforward solution is possible:
          First get the Line-objects from the plot



          linien = Cases[pp, _Line , Infinity];


          Two neighboring lines form a polygon from which the area can be calculated



          areas=Table[ Area@Polygon[Join[linien[[i]][[1]], Reverse[linien[[i + 1]][[1]]]]], {i,1, Length[linien] - 1}] 
          (*{0.0243947, 0.0281509, 0.0318023, 0.0353948, 0.039143, 0.0430014,
          0.0469289, 0.050997, 0.0551564, 0.0594015, 0.0639209, 0.0684968,
          0.0731468, 0.0780328, 0.0830698, 0.0882845, 0.0936695, 0.0992263,
          0.104955, 0.111007, 0.117283, 0.123424, 0.129694, 0.136315, 0.143126,
          0.150108, 0.157259, 0.164582, 0.172953, 0.1806, 0.187462, 0.195366,
          0.203387, 0.21151, 0.22005, 0.228322, 0.23627, 0.24457, 0.252866,
          0.261078, 0.269163, 0.27711, 0.284845, 0.292302, 0.299405, 0.306072,
          0.312203, 0.317686, 0.322383, 0.326143, 0.329235, 0.330515, 0.329747,
          0.327478, 0.322887, 0.315273, 0.304139, 0.288177, 0.265912, 0.234501,
          0.187173}*)


          That's it! Hope it helps.






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
            $endgroup$
            – Alper91
            Feb 23 at 15:30










          • $begingroup$
            Put it in a Table[...,{i,1,119}]
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 17:57










          • $begingroup$
            @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 19:44










          • $begingroup$
            Thanks. It worked easily.
            $endgroup$
            – Alper91
            Feb 24 at 7:29














          6












          6








          6





          $begingroup$

          You could define a ParametricRegion , examplary between curves #10 and #11



          reg10 = ParametricRegion[{{Cos[t], Sin[t]} Exp[(t + 2*Pi*ii/120)/2], (Sqrt[#.#] < radius) &[{Cos[t],Sin[t]} Exp[(t + 2*Pi*ii/120)/2] - ctr]}
          , {{t, -Pi, Pi}, {ii, 10, 11}}]
          DiscretizeRegion[reg10]


          enter image description here



          Area[DiscretizeRegion[reg10]]
          (*0.0592725*)


          addendum



          Knowing the plot pp a very fast straightforward solution is possible:
          First get the Line-objects from the plot



          linien = Cases[pp, _Line , Infinity];


          Two neighboring lines form a polygon from which the area can be calculated



          areas=Table[ Area@Polygon[Join[linien[[i]][[1]], Reverse[linien[[i + 1]][[1]]]]], {i,1, Length[linien] - 1}] 
          (*{0.0243947, 0.0281509, 0.0318023, 0.0353948, 0.039143, 0.0430014,
          0.0469289, 0.050997, 0.0551564, 0.0594015, 0.0639209, 0.0684968,
          0.0731468, 0.0780328, 0.0830698, 0.0882845, 0.0936695, 0.0992263,
          0.104955, 0.111007, 0.117283, 0.123424, 0.129694, 0.136315, 0.143126,
          0.150108, 0.157259, 0.164582, 0.172953, 0.1806, 0.187462, 0.195366,
          0.203387, 0.21151, 0.22005, 0.228322, 0.23627, 0.24457, 0.252866,
          0.261078, 0.269163, 0.27711, 0.284845, 0.292302, 0.299405, 0.306072,
          0.312203, 0.317686, 0.322383, 0.326143, 0.329235, 0.330515, 0.329747,
          0.327478, 0.322887, 0.315273, 0.304139, 0.288177, 0.265912, 0.234501,
          0.187173}*)


          That's it! Hope it helps.






          share|improve this answer











          $endgroup$



          You could define a ParametricRegion , examplary between curves #10 and #11



          reg10 = ParametricRegion[{{Cos[t], Sin[t]} Exp[(t + 2*Pi*ii/120)/2], (Sqrt[#.#] < radius) &[{Cos[t],Sin[t]} Exp[(t + 2*Pi*ii/120)/2] - ctr]}
          , {{t, -Pi, Pi}, {ii, 10, 11}}]
          DiscretizeRegion[reg10]


          enter image description here



          Area[DiscretizeRegion[reg10]]
          (*0.0592725*)


          addendum



          Knowing the plot pp a very fast straightforward solution is possible:
          First get the Line-objects from the plot



          linien = Cases[pp, _Line , Infinity];


          Two neighboring lines form a polygon from which the area can be calculated



          areas=Table[ Area@Polygon[Join[linien[[i]][[1]], Reverse[linien[[i + 1]][[1]]]]], {i,1, Length[linien] - 1}] 
          (*{0.0243947, 0.0281509, 0.0318023, 0.0353948, 0.039143, 0.0430014,
          0.0469289, 0.050997, 0.0551564, 0.0594015, 0.0639209, 0.0684968,
          0.0731468, 0.0780328, 0.0830698, 0.0882845, 0.0936695, 0.0992263,
          0.104955, 0.111007, 0.117283, 0.123424, 0.129694, 0.136315, 0.143126,
          0.150108, 0.157259, 0.164582, 0.172953, 0.1806, 0.187462, 0.195366,
          0.203387, 0.21151, 0.22005, 0.228322, 0.23627, 0.24457, 0.252866,
          0.261078, 0.269163, 0.27711, 0.284845, 0.292302, 0.299405, 0.306072,
          0.312203, 0.317686, 0.322383, 0.326143, 0.329235, 0.330515, 0.329747,
          0.327478, 0.322887, 0.315273, 0.304139, 0.288177, 0.265912, 0.234501,
          0.187173}*)


          That's it! Hope it helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 23 at 19:42

























          answered Feb 23 at 14:21









          Ulrich NeumannUlrich Neumann

          9,316516




          9,316516












          • $begingroup$
            Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
            $endgroup$
            – Alper91
            Feb 23 at 15:30










          • $begingroup$
            Put it in a Table[...,{i,1,119}]
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 17:57










          • $begingroup$
            @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 19:44










          • $begingroup$
            Thanks. It worked easily.
            $endgroup$
            – Alper91
            Feb 24 at 7:29


















          • $begingroup$
            Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
            $endgroup$
            – Alper91
            Feb 23 at 15:30










          • $begingroup$
            Put it in a Table[...,{i,1,119}]
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 17:57










          • $begingroup$
            @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
            $endgroup$
            – Ulrich Neumann
            Feb 23 at 19:44










          • $begingroup$
            Thanks. It worked easily.
            $endgroup$
            – Alper91
            Feb 24 at 7:29
















          $begingroup$
          Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
          $endgroup$
          – Alper91
          Feb 23 at 15:30




          $begingroup$
          Thank you very much! However, how could I store each of the ares into a table so I can show the histogram could you help me with that as well?
          $endgroup$
          – Alper91
          Feb 23 at 15:30












          $begingroup$
          Put it in a Table[...,{i,1,119}]
          $endgroup$
          – Ulrich Neumann
          Feb 23 at 17:57




          $begingroup$
          Put it in a Table[...,{i,1,119}]
          $endgroup$
          – Ulrich Neumann
          Feb 23 at 17:57












          $begingroup$
          @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
          $endgroup$
          – Ulrich Neumann
          Feb 23 at 19:44




          $begingroup$
          @ Alper91 Look at the edit of my answer, I added a solution which only needs to know pp
          $endgroup$
          – Ulrich Neumann
          Feb 23 at 19:44












          $begingroup$
          Thanks. It worked easily.
          $endgroup$
          – Alper91
          Feb 24 at 7:29




          $begingroup$
          Thanks. It worked easily.
          $endgroup$
          – Alper91
          Feb 24 at 7:29


















          draft saved

          draft discarded




















































          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%2f192068%2fcalculating-list-of-areas-between-the-curves-in-an-intersection-region%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

          mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?