{"id":574,"date":"2017-09-14T13:42:06","date_gmt":"2017-09-14T16:42:06","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=574"},"modified":"2017-09-14T13:42:06","modified_gmt":"2017-09-14T16:42:06","slug":"irrarea-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/irrarea-m\/","title":{"rendered":"irrarea.m"},"content":{"rendered":"<pre>function [a, xbar, ybar] = irrarea(D)\r\n% Computes area of irregular closed contour given by coordinates\r\n% stored in array D.  The first column of D contains the x-coordinate\r\n% and the second column contains the y-coordinates.\r\n%\r\n% Note: the first point will automatically be duplicated as the last\r\n%\r\n% USAGE:    area = irrarea(D)\r\n\r\nx = D(:,1);\r\ny = D(:,2);\r\nnm = length(x);\r\nn = nm+1;\r\nx(n) = x(1);\r\ny(n) = y(1);\r\n\r\nsum = 0;\r\nsumx = 0;\r\nsumy = 0;\r\n\r\nfor i=1:nm\r\n  dA =   (x(i)*y(i+1) - x(i+1)*y(i))\/2;\r\n  sum = sum + dA;\r\n  sumy = sumy + (y(i)+y(i+1)) * dA \/ 3;\r\n  sumx = sumx + (x(i)+x(i+1)) * dA \/ 3;\r\n\r\nend\r\na = sum;\r\nxbar = sumx \/ a;\r\nybar = sumy \/ a;\r\n\r\n\r\nplot(x,y,xbar,ybar,'r+')\r\n\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>function [a, xbar, ybar] = irrarea(D) % Computes area of irregular closed contour given by coordinates % stored in array D. The first column of D contains the x-coordinate % and the second column contains the y-coordinates. % % Note: the first point will automatically be duplicated as the last % % USAGE: area = [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-574","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=574"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/574\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/574\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}