convert spherical coordinates to adjust to specified radius [usage] newX = vb_convertSphereByRadius( X, radius ) [input] X : baseline 3-dimensions spherical coordinates radius : radius after converting [output] newX : converted coordinates [note] [history] 2006.06.29 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function newX = vb_convertSphereByRadius(X,radius) 0002 % convert spherical coordinates to adjust to specified radius 0003 % [usage] 0004 % newX = vb_convertSphereByRadius( X, radius ) 0005 % [input] 0006 % X : baseline 3-dimensions spherical coordinates 0007 % radius : radius after converting 0008 % [output] 0009 % newX : converted coordinates 0010 % [note] 0011 % 0012 % [history] 0013 % 2006.06.29 (Sako) initial version 0014 % 0015 % 0016 % Copyright (C) 2011, ATR All Rights Reserved. 0017 % License : New BSD License(see VBMEG_LICENSE.txt) 0018 0019 if ~exist('radius','var') 0020 radius = 1; 0021 end 0022 0023 newX = X .* radius; 0024