Home > vbmeg > functions > common > utility > vb_next_vertex_distance.m

vb_next_vertex_distance

PURPOSE ^

distance between next neighbor

SYNOPSIS ^

function [xxD] = vb_next_vertex_distance(F,V)

DESCRIPTION ^

 distance between next neighbor
   D = vb_next_vertex_distance(F,V)

 D : distance between next neighbor [Npatch*3 x 1]

 2007-12-22 Masa-aki Sato

 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    [xxD] = vb_next_vertex_distance(F,V)
0002 % distance between next neighbor
0003 %   D = vb_next_vertex_distance(F,V)
0004 %
0005 % D : distance between next neighbor [Npatch*3 x 1]
0006 %
0007 % 2007-12-22 Masa-aki Sato
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 xxD    = zeros(Npatch,3);
0014 
0015 % 3角面に関するループ
0016 for j=1:Npatch,
0017     % 3角面の頂点インデックス
0018     jx = F(j,:); 
0019     Vn = V(jx,:);
0020 
0021     % Distance
0022     d1 = sum((Vn(1,:) - Vn(2,:)).^2);
0023     d2 = sum((Vn(2,:) - Vn(3,:)).^2);
0024     d3 = sum((Vn(3,:) - Vn(1,:)).^2);
0025     
0026     xxD(j,:) = sqrt([d1, d2, d3]);
0027 end
0028 
0029 xxD = xxD(:);

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