Home > vbmeg > functions > brain > vb_find_big_triangle.m

vb_find_big_triangle

PURPOSE ^

Find triangle with large length

SYNOPSIS ^

function Findx = vb_find_big_triangle(F,V,Dmax)

DESCRIPTION ^

 Find triangle with large length
  Findx = vb_find_big_triangle(F,V,Dmax)

 Dmax : Max distance

 written by M. Sato  2005-4-17

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    Findx = vb_find_big_triangle(F,V,Dmax)
0002 % Find triangle with large length
0003 %  Findx = vb_find_big_triangle(F,V,Dmax)
0004 %
0005 % Dmax : Max distance
0006 %
0007 % written by M. Sato  2005-4-17
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 Npatch = size(F,1);          % number of patch
0013 dd=zeros(3,1);
0014 
0015 Findx = [];
0016 
0017 % 3角面に関するループ
0018 for j=1:Npatch,
0019     % 3角面の頂点インデックス
0020     k  = F(j,:); 
0021     % 3角面の頂点
0022     X = V(k,:);
0023     % 3辺の長さ
0024     dd(1) = (X(1,1)-X(2,1)).^2 + (X(1,2)-X(2,2)).^2 + (X(1,3)-X(2,3)).^2;
0025     dd(2) = (X(2,1)-X(3,1)).^2 + (X(2,2)-X(3,2)).^2 + (X(2,3)-X(3,3)).^2;
0026     dd(3) = (X(3,1)-X(1,1)).^2 + (X(3,2)-X(1,2)).^2 + (X(3,3)-X(1,3)).^2;
0027     
0028     if max(sqrt(dd)) > Dmax,
0029         Findx = [Findx; j];
0030     end
0031 end;

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005