CIRCLE3DORIGIN Return the first point of a 3D circle. P = circle3dOrigin([XC YC ZC R THETA PHI]) P = circle3dOrigin([XC YC ZC R THETA PHI PSI]) Returns the origin point of the circle, i.e. the first point used for drawing circle. See also circles3d, points3d, circle3dPosition
0001 function ori = circle3dOrigin(varargin) 0002 %CIRCLE3DORIGIN Return the first point of a 3D circle. 0003 % 0004 % P = circle3dOrigin([XC YC ZC R THETA PHI]) 0005 % P = circle3dOrigin([XC YC ZC R THETA PHI PSI]) 0006 % Returns the origin point of the circle, i.e. the first point used for 0007 % drawing circle. 0008 % 0009 % See also 0010 % circles3d, points3d, circle3dPosition 0011 0012 % ------ 0013 % Author: David Legland 0014 % E-mail: david.legland@inrae.fr 0015 % Created: 2005-02-21 0016 % Copyright 2005-2024 INRA - TPV URPOI - BIA IMASTE 0017 0018 % get center and radius 0019 circle = varargin{1}; 0020 xc = circle(:,1); 0021 yc = circle(:,2); 0022 zc = circle(:,3); 0023 r = circle(:,4); 0024 0025 % get angle of normal 0026 theta = circle(:,5); 0027 phi = circle(:,6); 0028 0029 % get roll 0030 if size(circle, 2)==7 0031 psi = circle(:,7); 0032 else 0033 psi = zeros(size(circle, 1), 1); 0034 end 0035 0036 % create origin point 0037 pt0 = [r 0 0]; 0038 0039 % compute transformation from local basis to world basis 0040 trans = localToGlobal3d(xc, yc, zc, theta, phi, psi); 0041 0042 % transform the point 0043 ori = transformPoint3d(pt0, trans);