Home > matGeom > geom3d > circle3dOrigin.m

circle3dOrigin

PURPOSE ^

CIRCLE3DORIGIN Return the first point of a 3D circle.

SYNOPSIS ^

function ori = circle3dOrigin(varargin)

DESCRIPTION ^

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

   ---------
   author : David Legland
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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 %   INRA - TPV URPOI - BIA IMASTE
0015 %   created the 21/02/2005
0016 %
0017 
0018 %   HISTORY
0019 
0020 % get center and radius
0021 circle = varargin{1};
0022 xc = circle(:,1);
0023 yc = circle(:,2);
0024 zc = circle(:,3);
0025 r  = circle(:,4);
0026 
0027 % get angle of normal
0028 theta   = circle(:,5);
0029 phi     = circle(:,6);
0030 
0031 % get roll
0032 if size(circle, 2)==7
0033     psi = circle(:,7);
0034 else
0035     psi = zeros(size(circle, 1), 1);
0036 end
0037 
0038 % create origin point
0039 pt0 = [r 0 0];
0040 
0041 % compute transformation from local basis to world basis
0042 trans   = localToGlobal3d(xc, yc, zc, theta, phi, psi);
0043 
0044 % transform the point
0045 ori = transformPoint3d(pt0, trans);

Generated on Wed 16-Feb-2022 15:10:47 by m2html © 2003-2019