0
$\begingroup$

I have the following data that are produced from experimental observations:

     k =  {{0., 0.}, {0.003, 210.}, {0.0031, 217.}, {0.0032, 224.}, {0.0033, 
  231.}, {0.0034, 238.}, {0.0035, 245.}, {0.0036, 252.}, {0.0037, 
  259.}, {0.0038, 266.}, {0.0039, 273.}, {0.004, 280.}, {0.0041, 
  287.}, {0.0042, 294.}, {0.0043, 301.}, {0.0044, 308.}, {0.0045, 
  315.}, {0.0046, 322.}, {0.0047, 329.}, {0.0048, 336.}, {0.0049, 
  343.}, {0.005, 350.}, {0.0051, 357.}, {0.0052, 364.}, {0.0053, 
  371.}, {0.0054, 378.}, {0.0055, 385.}, {0.00555, 
  388.5}, {0.00556237, 389.366}, {0.0055685, 389.795}, {0.00557001, 
  389.901}, {0.00557076, 389.953}, {0.0055715, 390.}, {0.00557218, 
  390.002}, {0.00557282, 390.003}, {0.005574, 389.979}, {0.00557613, 
  389.85}, {0.00558022, 389.45}, {0.00558807, 388.46}, {0.00560313, 
  386.315}, {0.00563202, 382.009}, {0.00568743, 373.634}, {0.00578743,
   359.779}, {0.00588743, 358.837}, {0.00598743, 
  359.427}, {0.00608743, 358.903}, {0.00618743, 359.506}, {0.00628743,
   358.994}, {0.00638743, 359.59}, {0.00648743, 359.086}, {0.00658743,
   359.675}, {0.00668743, 359.178}, {0.00678743, 359.76}, {0.00688743,
   359.269}, {0.00698743, 359.845}, {0.00708743, 359.36}, {0.00718743,
   359.931}, {0.00728743, 359.451}, {0.00738743, 
  360.016}, {0.00748743, 359.541}, {0.00758743, 360.102}, {0.00768743,
   359.631}, {0.00778743, 360.189}, {0.00788743, 
  359.721}, {0.00798743, 360.275}, {0.00808743, 359.811}, {0.00818743,
   360.362}, {0.00828743, 359.901}, {0.00838743, 
  360.448}, {0.00848743, 359.99}, {0.00858743, 360.536}, {0.00868743, 
  360.08}, {0.00878743, 360.623}, {0.00888743, 360.17}, {0.00898743, 
  360.711}, {0.00908743, 360.26}, {0.00918743, 360.798}, {0.00928743, 
  360.367}, {0.00938743, 360.888}, {0.00948743, 360.478}, {0.00958743,
   360.979}, {0.00968743, 360.589}, {0.00978743, 
  361.069}, {0.00988743, 360.701}, {0.00998743, 361.16}, {0.0100874, 
  360.813}, {0.0101874, 361.252}, {0.0102874, 360.924}, {0.0103874, 
  361.343}, {0.0104874, 361.036}, {0.0105874, 361.435}, {0.0106874, 
  361.148}, {0.0107874, 361.527}, {0.0108874, 361.259}, {0.0109874, 
  361.619}, {0.0110874, 361.371}, {0.0111874, 361.712}, {0.0112874, 
  361.483}, {0.0113874, 361.804}, {0.0114874, 361.595}, {0.0115874, 
  361.897}, {0.0116874, 361.707}, {0.0117874, 361.99}, {0.0118874, 
  361.819}, {0.0119874, 362.083}, {0.0120874, 361.932}, {0.0121874, 
  362.176}, {0.0122874, 362.044}, {0.0123874, 362.269}, {0.0124874, 
  362.157}, {0.0125874, 362.363}, {0.0126874, 362.269}, {0.0127874, 
  362.456}, {0.0128874, 362.382}, {0.0129874, 362.55}, {0.0130874, 
  362.495}, {0.0131874, 362.644}, {0.0132874, 362.608}, {0.0133874, 
  362.738}, {0.0134874, 362.721}, {0.0135874, 362.832}, {0.0136874, 
  362.834}, {0.0137874, 362.926}, {0.0138874, 362.947}, {0.0139874, 
  363.021}, {0.0140874, 363.06}, {0.0141874, 363.115}, {0.0142874, 
  363.174}, {0.0143874, 363.21}, {0.0144874, 363.287}, {0.0145874, 
  363.304}, {0.0146874, 363.401}, {0.0147874, 363.399}, {0.0148874, 
  363.514}, {0.0149874, 363.494}, {0.0150874, 363.628}, {0.0151874, 
  363.589}, {0.0152874, 363.742}, {0.0153874, 363.684}, {0.0154874, 
  363.856}, {0.0155874, 363.779}, {0.0156874, 363.971}, {0.0157874, 
  363.874}, {0.0158874, 364.085}, {0.0159874, 363.97}, {0.0160874, 
  364.199}, {0.0161874, 364.065}, {0.0162874, 364.314}, {0.0163874, 
  364.161}, {0.0164874, 364.428}, {0.0165874, 364.256}, {0.0166874, 
  364.543}, {0.0167874, 364.352}, {0.0168874, 364.658}, {0.0169874, 
  364.448}, {0.0170874, 364.773}, {0.0171874, 364.544}, {0.0172874, 
  364.888}, {0.0173874, 364.64}, {0.0174874, 365.003}, {0.0175874, 
  364.736}, {0.0176874, 365.118}, {0.0177874, 364.832}, {0.0178874, 
  365.234}, {0.0179874, 364.929}, {0.0180874, 365.349}, {0.0181874, 
  365.025}, {0.0182874, 365.465}, {0.0183874, 365.121}, {0.0184874, 
  365.581}, {0.0185874, 365.218}, {0.0186874, 365.697}, {0.0187874, 
  365.315}, {0.0188874, 365.813}, {0.0189874, 365.412}, {0.0190874, 
  365.927}, {0.0191874, 365.508}, {0.0192874, 366.024}, {0.0193874, 
  365.603}, {0.0194874, 366.119}, {0.0195874, 365.698}, {0.0196874, 
  366.213}, {0.0197874, 365.793}, {0.0198874, 366.308}, {0.0199874, 
  365.887}, {0.0200874, 366.403}, {0.0201874, 365.982}, {0.0202874, 
  366.498}, {0.0203874, 366.077}, {0.0204874, 366.593}, {0.0205874, 
  366.172}, {0.0206874, 366.687}, {0.0207874, 366.267}, {0.0208874, 
  366.782}, {0.0209874, 366.362}, {0.0210874, 366.878}, {0.0211874, 
  366.457}, {0.0212874, 366.973}, {0.0213874, 366.552}, {0.0214874, 
  367.068}, {0.0215874, 366.647}, {0.0216874, 367.163}, {0.0217874, 
  366.742}, {0.0218874, 367.259}, {0.0219874, 366.838}, {0.0220874, 
  367.354}, {0.0221874, 366.933}, {0.0222874, 367.45}, {0.0223874, 
  367.029}, {0.0224874, 367.545}, {0.0225874, 367.124}, {0.0226874, 
  367.641}, {0.0227874, 367.22}, {0.0228874, 367.737}, {0.0229874, 
  367.319}, {0.0230874, 367.833}, {0.0231874, 367.436}, {0.0232874, 
  367.931}, {0.0233874, 367.554}, {0.0234874, 368.029}, {0.0235874, 
  367.671}, {0.0236874, 368.128}, {0.0237874, 367.79}, {0.0238874, 
  368.226}, {0.0239874, 367.908}, {0.0240874, 368.325}, {0.0241874, 
  368.027}, {0.0242874, 368.424}, {0.0243874, 368.145}, {0.0244874, 
  368.523}, {0.0245874, 368.264}, {0.0246874, 368.622}, {0.0247874, 
  368.383}, {0.0248874, 368.722}, {0.0249874, 368.502}, {0.025, 
  368.416}, {0.0249999, 368.405}, {0.0249997, 368.386}, {0.0249993, 
  368.351}, {0.0249986, 368.291}, {0.0249973, 368.191}, {0.0249947, 
  368.009}, {0.0249897, 367.66}, {0.0249798, 366.969}, {0.0249603, 
  365.602}, {0.0249216, 362.895}, {0.0248451, 357.538}, {0.0247451, 
  350.538}, {0.0246451, 343.538}, {0.0245451, 336.538}, {0.0244451, 
  329.538}, {0.0243451, 322.538}, {0.0242451, 315.538}, {0.0241451, 
  308.538}, {0.0240451, 301.538}, {0.0239451, 294.538}, {0.0238451, 
  287.538}, {0.0237451, 280.538}, {0.0236451, 273.538}, {0.0235451, 
  266.538}, {0.0234451, 259.538}, {0.0233451, 252.538}, {0.0232451, 
  245.538}, {0.0231451, 238.538}, {0.0230451, 231.538}, {0.0229451, 
  224.538}, {0.0228451, 217.538}, {0.0227451, 210.538}, {0.0226451, 
  203.538}, {0.0225451, 196.538}, {0.0224451, 189.538}, {0.0223451, 
  182.538}, {0.0222451, 175.538}, {0.0221451, 168.538}, {0.0220451, 
  161.564}, {0.0219451, 154.564}, {0.0218451, 147.565}, {0.0217451, 
  140.565}, {0.0216451, 134.184}, {0.0215451, 133.375}, {0.0214451, 
  132.149}, {0.0213451, 132.076}, {0.0212451, 131.101}, {0.0211451, 
  130.987}, {0.0210451, 130.293}, {0.0209451, 130.112}, {0.0208451, 
  129.633}, {0.0207451, 129.384}, {0.0206451, 129.078}, {0.0205451, 
  128.77}, {0.0204451, 128.608}, {0.0203451, 128.249}, {0.0202451, 
  128.21}, {0.0201451, 127.807}, {0.0200451, 127.872}, {0.0199451, 
  127.433}, {0.0198451, 127.588}, {0.0197451, 127.12}, {0.0196451, 
  127.35}, {0.0195451, 126.858}, {0.0194451, 127.153}, {0.0193451, 
  126.643}, {0.0192451, 126.991}, {0.0191451, 126.478}, {0.0190451, 
  126.862}, {0.0189451, 126.349}, {0.0188451, 126.76}, {0.0187451, 
  126.246}, {0.0186451, 126.682}, {0.0185451, 126.168}, {0.0184451, 
  126.625}, {0.0183451, 126.112}, {0.0182451, 126.587}, {0.0181451, 
  126.074}, {0.0180451, 126.565}, {0.0179451, 126.054}, {0.0178451, 
  126.557}, {0.0177451, 126.05}, {0.0176451, 126.561}, {0.0175451, 
  126.059}, {0.0174451, 126.577}, {0.0173451, 126.08}, {0.0172451, 
  126.602}, {0.0171451, 126.113}, {0.0170451, 126.635}, {0.0169451, 
  126.156}, {0.0168451, 126.676}, {0.0167451, 126.207}, {0.0166451, 
  126.724}, {0.0165451, 126.267}, {0.0164451, 126.778}, {0.0163451, 
  126.335}, {0.0162451, 126.836}, {0.0161451, 126.409}, {0.0160451, 
  126.899}, {0.0159451, 126.489}, {0.0158451, 126.966}, {0.0157451, 
  126.575}, {0.0156451, 127.037}, {0.0155451, 126.665}, {0.0154451, 
  127.111}, {0.0153451, 126.761}, {0.0152451, 127.187}, {0.0151451, 
  126.861}, {0.0150451, 127.266}, {0.0149451, 126.964}, {0.0148451, 
  127.348}, {0.0147451, 127.072}, {0.0146451, 127.431}, {0.0145451, 
  127.183}, {0.0144451, 127.515}, {0.0143451, 127.297}, {0.0142451, 
  127.602}, {0.0141451, 127.414}, {0.0140451, 127.69}, {0.0139451, 
  127.533}, {0.0138451, 127.779}, {0.0137451, 127.656}, {0.0136451, 
  127.869}, {0.0135451, 127.78}, {0.0134451, 127.96}, {0.0133451, 
  127.907}, {0.0132451, 128.052}, {0.0131451, 128.037}, {0.0130451, 
  128.145}, {0.0129451, 128.168}, {0.0128451, 128.238}, {0.0127451, 
  128.286}, {0.0126451, 128.331}, {0.0125451, 128.377}, {0.0124451, 
  128.422}, {0.0123451, 128.468}, {0.0122451, 128.513}, {0.0121451, 
  128.558}, {0.0120451, 128.603}, {0.0119451, 128.649}, {0.0118451, 
  128.694}, {0.0117451, 128.74}, {0.0116451, 128.785}, {0.0115451, 
  128.831}, {0.0114451, 128.876}, {0.0113451, 128.922}, {0.0112451, 
  128.968}, {0.0111451, 129.014}, {0.0110451, 129.06}, {0.0109451, 
  129.106}, {0.0108451, 129.151}, {0.0107451, 129.197}, {0.0106451, 
  129.243}, {0.0105451, 129.29}, {0.0104451, 129.335}, {0.0103451, 
  129.382}, {0.0102451, 129.428}, {0.0101451, 129.474}, {0.0100451, 
  129.52}, {0.00994509, 129.567}, {0.00984509, 129.613}, {0.00974509, 
  129.659}, {0.00964509, 129.706}, {0.00954509, 129.752}, {0.00944509,
   129.798}, {0.00934509, 129.845}, {0.00924509, 
  129.891}, {0.00914509, 129.938}, {0.00904509, 129.984}, {0.00894509,
   130.031}, {0.00884509, 130.078}, {0.00874509, 
  130.125}, {0.00864509, 130.171}, {0.00854509, 130.218}, {0.00844509,
   130.264}, {0.00834509, 130.312}, {0.00824509, 
  130.362}, {0.00814509, 130.406}, {0.00804509, 130.475}, {0.00794509,
   130.501}, {0.00784509, 130.592}, {0.00774509, 
  130.598}, {0.00764509, 130.715}, {0.00754509, 130.694}, {0.00744509,
   130.842}, {0.00734509, 130.792}, {0.00724509, 
  130.972}, {0.00714509, 130.89}, {0.00704509, 131.108}, {0.00694509, 
  130.988}, {0.00684509, 131.247}, {0.00674509, 131.087}, {0.00664509,
   131.391}, {0.00654509, 131.186}, {0.00644509, 
  131.539}, {0.00634509, 131.286}, {0.00624509, 131.692}, {0.00614509,
   131.386}, {0.00604509, 131.849}, {0.00594509, 
  131.486}, {0.00584509, 132.012}, {0.00574509, 131.587}, {0.00564509,
   132.181}, {0.00554509, 131.688}, {0.00544509, 
  132.257}, {0.00534509, 131.78}, {0.00524509, 132.338}, {0.00514509, 
  131.873}, {0.00504509, 132.429}, {0.00494509, 131.966}, {0.00484509,
   132.532}, {0.00474509, 132.06}, {0.00464509, 132.646}, {0.00454509,
   132.155}, {0.00444509, 132.764}, {0.00434509, 132.25}, {0.00424509,
   132.862}, {0.00414509, 132.344}, {0.00404509, 
  132.961}, {0.00394509, 132.437}, {0.00384509, 133.059}, {0.00374509,
   132.53}, {0.00364509, 133.158}, {0.00354509, 132.639}, {0.00349509,
   132.946}, {0.00345326, 132.968}, {0.00341526, 133.09}, {0.00334625,
   133.124}, {0.00329625, 133.079}, {0.00321258, 
  133.047}, {0.00311258, 133.24}, {0.00301258, 133.116}, {0.00291258, 
  133.344}, {0.00281258, 133.271}, {0.00280008, 133.389}, {0.00278809,
   133.5}, {0.00276631, 133.764}, {0.00276109, 133.837}, {0.00275858, 
  133.845}, {0.00275618, 133.958}, {0.00275216, 138.111}, {0.00274851,
   150.654}, {0.0027452, 155.581}, {0.00273883, 155.136}, {0.00272624,
   154.254}, {0.00270132, 152.51}, {0.00265197, 149.056}, {0.0025543, 
  142.218}, {0.0024543, 135.218}, {0.0023543, 133.235}, {0.0022543, 
  133.288}, {0.0021543, 150.801}, {0.0020543, 143.801}, {0.0019543, 
  136.801}, {0.0018543, 129.801}, {0.0017543, 122.801}, {0.0016543, 
  115.801}, {0.0015543, 108.801}, {0.0014543, 101.801}, {0.0013543, 
  94.8007}, {0.0012543, 87.8007}, {0.0011543, 80.8007}, {0.0010543, 
  73.8007}, {0.000954295, 66.8007}, {0.000854295, 
  59.8007}, {0.000754295, 52.8007}, {0.000654295, 
  45.8007}, {0.000554295, 38.8007}, {0.000454295, 
  31.8007}, {0.000354295, 24.8007}, {0.000254295, 
  17.8007}, {0.000154295, 10.8007}, {0.0000542955, 
  3.80068}, {0., -2.91434*10^-13}}

Sorry, it is a big vector, but I had no choice but to paste the whole thing into this post. Anyway, if I plot it using the following command and fill it:

plot = {k} // 
  ListPlot[#, 
    Joined -> True, PlotRange -> All,  
    PlotStyle -> {Red}, Frame -> True,  FrameStyle -> Black, 
    ImageSize -> 500, Filling -> Bottom] &

I will get a filled area. The question is how can I calculate the area of this filled area of the plot. I would like to have a general solution which can be applied to any closed shape.

P.S. I searched the previous questions. I found methods for finding the areas of image components in JPEG files, but not for shapes produced by ListLinePlot.

$\endgroup$
3
$\begingroup$
Graphics[Polygon[k], AspectRatio -> 1, Frame -> True]

enter image description here

to reduce computing time I take 1 in 30 points for the area:

Area[Polygon[k[[;; ;; 30]]]]

4.60361

$\endgroup$
3
$\begingroup$

The signed area enclosed by a polygonal line in the plane can be obtained by summing up the signed areas of the triangles spanned by each edge with point {0.,0.}. We can use Det to compute the signed areas of triangles.

p = Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/1000}];
area[p_?MatrixQ] := 0.5 Total[Det /@ Transpose[{p, RotateLeft[p]}]];
Pi - area[p]

(* 0.0000206708 *)

In your case area[k] computes to -4.62603.

$\endgroup$
  • 1
    $\begingroup$ See this for another implementation of the "shoelace formula". $\endgroup$ – J. M. is in limbo Jul 28 '17 at 5:02
  • $\begingroup$ @J.M.: Nice, I did not know that this formula was called this way. Thanks! $\endgroup$ – Henrik Schumacher Jul 28 '17 at 7:08
2
$\begingroup$

Define mesh:

mesh = MeshRegion[k, Polygon[Range[Length[k]]], AspectRatio -> 1];
Area[mesh]

4.62603

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.