亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? inpoly.m

?? 一個功能強大的非結構網格劃分程序,可實現網格的自動剖分,及局部加密與質量控制
?? M
字號:
function [cn,on] = inpoly(p,node,edge)

%  INPOLY: Point-in-polygon testing.
%
% Determine whether a series of points lie within the bounds of a polygon
% in the 2D plane. General non-convex, multiply-connected polygonal
% regions can be handled.
%
%  SHORT SYNTAX:
%
%   in = inpoly(p,node);
%
%   p   : The points to be tested as an Nx2 array [x1 y1; x2 y2; etc].
%   node: The vertices of the polygon as an Mx2 array [X1 Y1; X2 Y2; etc].
%         The standard syntax assumes that the vertices are specified in
%         consecutive order.
%
%   in  : An Nx1 logical array with IN(i) = TRUE if P(i,:) lies within the
%         region.
%
%  LONG SYNTAX:
%
%  [in,on] = inpoly(p,node,edge);
%
%  edge: An Mx2 array of polygon edges, specified as connections between
%        the vertices in NODE: [n1 n2; n3 n4; etc]. The vertices in NODE
%        do not need to be specified in connsecutive order when using the
%        extended syntax.
%
%  on  : An Nx1 logical array with ON(i) = TRUE if P(i,:) lies on a
%        polygon edge. (A tolerance is used to deal with numerical
%        precision, so that points within a distance of
%        eps^0.8*norm(node(:),inf) from a polygon edge are considered "on"
%        the edge.
%
% EXAMPLE:
%
%   polydemo;       % Will run a few examples
%
% See also INPOLYGON

% The algorithm is based on the crossing number test, which counts the
% number of times a line that extends from each point past the right-most
% region of the polygon intersects with a polygon edge. Points with odd
% counts are inside. A simple implementation of this method requires each
% wall intersection be checked for each point, resulting in an O(N*M)
% operation count.
%
% This implementation does better in 2 ways:
%
%   1. The test points are sorted by y-value and a binary search is used to
%      find the first point in the list that has a chance of intersecting
%      with a given wall. The sorted list is also used to determine when we
%      have reached the last point in the list that has a chance of
%      intersection. This means that in general only a small portion of
%      points are checked for each wall, rather than the whole set.
%
%   2. The intersection test is simplified by first checking against the
%      bounding box for a given wall segment. Checking against the bbox is
%      an inexpensive alternative to the full intersection test and allows
%      us to take a number of shortcuts, minimising the number of times the
%      full test needs to be done.
%
%   Darren Engwirda: 2005-2007
%   Email          : d_engwirda@hotmail.com
%   Last updated   : 23/05/2007 with MATLAB 7.0
%
% Problems or suggestions? Email me.

%% ERROR CHECKING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin<3
   edge = [];
   if nargin<2
      error('Insufficient inputs');
   end
end
nnode = size(node,1);
if isempty(edge)                                                           % Build edge if not passed
   edge = [(1:nnode-1)' (2:nnode)'; nnode 1];
end
if size(p,2)~=2
   error('P must be an Nx2 array.');
end
if size(node,2)~=2
   error('NODE must be an Mx2 array.');
end
if size(edge,2)~=2
   error('EDGE must be an Mx2 array.');
end
if max(edge(:))>nnode || any(edge(:)<1)
   error('Invalid EDGE.');
end

%% PRE-PROCESSING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
n  = size(p,1);
nc = size(edge,1);

% Choose the direction with the biggest range as the "y-coordinate" for the
% test. This should ensure that the sorting is done along the best
% direction for long and skinny problems wrt either the x or y axes.
dxy = max(p)-min(p);
if dxy(1)>dxy(2)
   % Flip co-ords if x range is bigger
   p    = p(:,[2,1]);
   node = node(:,[2,1]);
end

% Sort test points by y-value
[y,i] = sort(p(:,2));
x = p(i,1);

%% MAIN LOOP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cn = false(n,1);     % Because we're dealing with mod(cn,2) we don't have
                     % to actually increment the crossing number, we can
                     % just flip a logical at each intersection (faster!)
on = cn;
for k = 1:nc         % Loop through edges

   % Nodes in current edge
   n1 = edge(k,1);
   n2 = edge(k,2);

   % Endpoints - sorted so that [x1,y1] & [x2,y2] has y1<=y2
   %           - also get xmin = min(x1,x2), xmax = max(x1,x2)
   y1 = node(n1,2);
   y2 = node(n2,2);
   if y1<y2
      x1 = node(n1,1);
      x2 = node(n2,1);
   else
      yt = y1;
      y1 = y2;
      y2 = yt;
      x1 = node(n2,1);
      x2 = node(n1,1);
   end
   if x1>x2
      xmin = x2;
      xmax = x1;
   else
      xmin = x1;
      xmax = x2;
   end

   % Binary search to find first point with y<=y1 for current edge
   if y(1)>=y1
      start = 1;
   elseif y(n)<=y1
      start = n+1;        % Higher than all points, don't test any!
   else
      lower = 1;
      upper = n;
      for j = 1:n
         start = round(0.5*(lower+upper));
         if y(start)<y1
            lower = start;
         elseif y(start-1)<y1
            break;
         else
            upper = start;
         end
      end
   end

   % Choose a tolerance for each edge based on the bbox size
   tol = 100*eps*(y2-y1+xmax-xmin);

   % Loop through points
   for j = start:n
      % Check the bounding-box for the edge before doing the intersection
      % test. Take shortcuts wherever possible!

      Y = y(j);   % Do the array look-up once & make a temp scalar
      if Y<=y2
         X = x(j);   % Do the array look-up once & make a temp scalar
         if X>=xmin
            if X<=xmax

               % Check if we're "on" the edge
               on(j) = on(j) || (abs((y2-Y)*(x1-X)-(y1-Y)*(x2-X))<tol);

               % Do the actual intersection test
               if (Y<y2) && ((y2-y1)*(X-x1)<(Y-y1)*(x2-x1))
                  cn(j) = ~cn(j);
               end

            end
         elseif Y<y2   % Deal with points exactly at vertices
            % Has to cross edge
            cn(j) = ~cn(j);
         end
      else
         % Due to the sorting, no points with >y
         % value need to be checked
         break
      end
   end

end

% Re-index to undo the sorting
cn(i) = cn|on;
on(i) = on;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲影视在线播放| 国产一区二区电影| 精品一二线国产| 91免费版pro下载短视频| 欧美一区二区视频在线观看2022| 欧美精品一区二区三区久久久| 亚洲视频在线一区| 国产一区二区在线视频| 欧美浪妇xxxx高跟鞋交| 中文字幕一区二区三区四区| 久久国产成人午夜av影院| 日本韩国视频一区二区| 中文字幕乱码日本亚洲一区二区| 全国精品久久少妇| 欧美亚洲国产bt| 亚洲欧美区自拍先锋| 国产成人在线观看| 久久品道一品道久久精品| 日本亚洲电影天堂| 欧美午夜电影网| 亚洲免费av在线| 北条麻妃国产九九精品视频| 久久综合色播五月| 日韩激情av在线| 欧美日韩在线播放一区| 亚洲免费av高清| 色悠悠久久综合| 一区二区三区四区国产精品| 99re8在线精品视频免费播放| 国产欧美精品一区二区色综合朱莉 | 成人免费视频app| 欧美精品一区二区久久婷婷| 美腿丝袜亚洲三区| 日韩精品一区二区三区三区免费 | 亚洲一区二区五区| 色综合一个色综合| 亚洲激情校园春色| 欧美探花视频资源| 五月激情六月综合| 日韩欧美在线123| 寂寞少妇一区二区三区| 2023国产精品| 国产成人99久久亚洲综合精品| 久久久www免费人成精品| 国产不卡在线视频| 中文字幕在线一区免费| 色素色在线综合| 亚洲成人午夜电影| 欧美大片顶级少妇| 国产精品 欧美精品| 亚洲欧洲精品成人久久奇米网| 丁香六月久久综合狠狠色| 中文字幕一区在线| 欧美色图天堂网| 久久精品免费观看| 国产精品婷婷午夜在线观看| 91免费视频大全| 三级不卡在线观看| 久久午夜老司机| 色综合咪咪久久| 日韩专区中文字幕一区二区| 久久综合色8888| 一本久久综合亚洲鲁鲁五月天 | 精品一区二区免费在线观看| 国产午夜精品久久| 欧美综合天天夜夜久久| 奇米一区二区三区| 国产精品成人免费精品自在线观看| 色综合久久天天| 久久99蜜桃精品| 亚洲嫩草精品久久| 精品久久人人做人人爽| 99精品视频一区二区三区| 爽好多水快深点欧美视频| 国产亚洲精品aa午夜观看| 欧美性大战xxxxx久久久| 国产精品88888| 亚洲高清不卡在线| 中文字幕av资源一区| 欧美日韩精品欧美日韩精品一 | 日韩va欧美va亚洲va久久| 久久精品欧美一区二区三区麻豆| 91久久免费观看| 国产精品一区一区三区| 婷婷综合久久一区二区三区| 亚洲欧洲www| 欧美v亚洲v综合ⅴ国产v| 国产欧美一区二区精品忘忧草| av一区二区三区黑人| 另类人妖一区二区av| 一区二区三区中文字幕| 久久女同精品一区二区| 67194成人在线观看| 色呦呦网站一区| 成人a级免费电影| 国内精品写真在线观看| 日韩国产欧美三级| 一区二区三区在线观看欧美| 国产亲近乱来精品视频| 欧美v亚洲v综合ⅴ国产v| 777xxx欧美| 欧美日韩亚洲国产综合| 日本精品视频一区二区| av电影在线观看一区| 国产suv精品一区二区三区| 精品一区二区影视| 日韩极品在线观看| 日韩电影在线观看一区| 天天射综合影视| 午夜影院在线观看欧美| 亚洲国产精品一区二区尤物区| 亚洲欧洲综合另类| 亚洲男人的天堂网| 亚洲免费三区一区二区| 亚洲视频一区二区在线观看| 国产精品久久久久aaaa| 国产精品久久久久国产精品日日 | 亚洲视频一区二区在线观看| 中文字幕在线视频一区| 国产精品欧美极品| 最新久久zyz资源站| 国产精品国产三级国产| 国产精品国产自产拍高清av| 中文字幕中文字幕一区| 亚洲毛片av在线| 亚洲综合色网站| 日韩中文字幕亚洲一区二区va在线| 亚洲第一福利一区| 美女爽到高潮91| 国产麻豆视频一区二区| www.欧美日韩国产在线| 99国产精品国产精品久久| 在线视频国内一区二区| 欧美高清精品3d| 精品剧情在线观看| 国产精品免费视频网站| 亚洲人成在线播放网站岛国| 亚洲国产另类精品专区| 九九久久精品视频| 成人av网站在线| 在线观看精品一区| 日韩精品一区国产麻豆| |精品福利一区二区三区| 亚洲自拍偷拍av| 国产一区二区精品久久99| 99视频有精品| 884aa四虎影成人精品一区| 国产日产欧美一区二区视频| 亚洲欧美电影院| 久久机这里只有精品| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产精品国产三级国产aⅴ中文| 亚洲精品日日夜夜| 久久精品国产77777蜜臀| 99久久99久久综合| 欧美一区二区在线免费观看| 亚洲国产精品精华液2区45| 丝袜美腿亚洲一区二区图片| 欧美一区二区网站| 中文字幕+乱码+中文字幕一区| 亚洲国产婷婷综合在线精品| 国产精品一区二区91| 99国产一区二区三精品乱码| 欧美一区二区成人6969| 国产精品盗摄一区二区三区| 美日韩黄色大片| 在线观看亚洲专区| 国产欧美一二三区| 久久av资源网| 欧美日韩一区二区在线视频| 国产日产精品一区| 另类小说图片综合网| 精品视频在线免费观看| 国产精品久久久久久久久免费桃花| 日韩精品免费视频人成| 色婷婷综合视频在线观看| 久久久久久久久久久电影| 亚洲成人精品影院| 91麻豆精东视频| 欧美国产精品专区| 久久97超碰国产精品超碰| 欧美视频一二三区| 亚洲日本乱码在线观看| 国产传媒欧美日韩成人| 日韩欧美www| 天天亚洲美女在线视频| 欧美性生交片4| 一区二区三区美女视频| 91在线视频网址| 国产精品拍天天在线| 国产精品99久久久久久宅男| 亚洲精品一区二区三区精华液| 日精品一区二区三区| 欧美色涩在线第一页| 一区2区3区在线看| 欧美午夜精品一区| 亚洲伊人伊色伊影伊综合网| 色伊人久久综合中文字幕| 亚洲精品成人少妇| 91搞黄在线观看|